I am using a WebView with BuiltInZoomControls enabled. I can view the data in WebView properly and also i can use the zoom controls to zoom it. But when i click back to move to previous screen i get Exception and app crashes. ( Other thing it works properly if i don't use zoom controls. i mean zoom controls are enabled in WebView but i have not used, just viewed the WebView content and clicked back.)
WebView:
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setSupportZoom(true);
mWebView.getSettings().setPluginState(PluginState.ON);
Exceptions:
Activity com.web.ui.DetailActivity has leaked window android.widget.ZoomButtonsController$Container@4110c4e0 that was originally added here
.....
FATAL EXCEPTION: main
E/AndroidRuntime(670): java.lang.IllegalArgumentException: Receiver not registered: android.widget.ZoomButtonsController$1@4110c2d0
....
And onDestroy of Activity i am also adding this:
mWebView.getSettings().setBuiltInZoomControls(false);
Any idea what could be the issue. Need help.
Thanks
Add this to your activity:
@Override
public void finish() {
ViewGroup view = (ViewGroup) getWindow().getDecorView();
view.removeAllViews();
super.finish();
}
Make sure you do
setVisible(false);
in onDestroy()
before you call the super or call destroy() on your webView object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With