WebView with BuiltInZoomControls throwing Exceptions and crashing

Viewed 4705

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

4 Answers
Related