Browse Source

fix(android): Fixes black screen on back button press (#1298 by @michan85)

Co-authored-by: michael hancock <michael.hancock@24.com>
Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
michael hancock 4 years ago
parent
commit
0317a4b4a5
No account linked to committer's email address

+ 15
- 0
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

@@ -1234,6 +1234,21 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
1234 1234
       destroy();
1235 1235
     }
1236 1236
 
1237
+    WebChromeClient mWebChromeClient;
1238
+    @Override
1239
+    public void setWebChromeClient(WebChromeClient client) {
1240
+      this.mWebChromeClient = client;
1241
+      super.setWebChromeClient(client);
1242
+    }
1243
+
1244
+    @Override
1245
+    public void destroy() {
1246
+      if(mWebChromeClient!=null){
1247
+        mWebChromeClient.onHideCustomView();
1248
+      }
1249
+      super.destroy();
1250
+    }
1251
+
1237 1252
     protected class RNCWebViewBridge {
1238 1253
       RNCWebView mContext;
1239 1254