From 2d01bd0421b23715ee9ae5176c9f243afe0541e3 Mon Sep 17 00:00:00 2001 From: Valerie Ivangorodsky Date: Mon, 29 Oct 2018 20:42:53 +0700 Subject: [PATCH] Forward onPause and onResume to WebView. Required to pause video on web page when app become inactive. --- src/android/ThemeableBrowser.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/android/ThemeableBrowser.java b/src/android/ThemeableBrowser.java index 673e0d828..e49426ffb 100644 --- a/src/android/ThemeableBrowser.java +++ b/src/android/ThemeableBrowser.java @@ -1382,6 +1382,22 @@ public View getView (int position, View convertView, ViewGroup parent) { } } + /** + * Called when the system is about to start resuming a previous activity. + */ + @Override + public void onPause(boolean multitasking) { + if(inAppWebView != null) inAppWebView.onPause(); + } + + /** + * Called when the activity will start interacting with the user. + */ + @Override + public void onResume(boolean multitasking) { + if(inAppWebView != null) inAppWebView.onResume(); + } + /** * A class to hold parsed option properties.