How to enable ZoomControls in android WebView when open specific URL? -
i'm using webview in android; want show zoomcontrols not pages specific webpage. should do? please help!
assuming it's activity , receiving url intent
string url = getintent().getstringextra("url"); webview webview = (webview) findviewbyid(r.id.webview_id_here) webview.getsettings().setbuiltinzoomcontrols(url.equals("your_url_here"));
if want happen every time url changes, use custom webview client.
webview.setwebviewclient(new customwebviewclient());
wherever webview initialized. customwebviewclient :
private class customwebviewclient extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); view.getsettings().setbuiltinzoomcontrols(url.equals("your_url_here")); return false; } }
Comments
Post a Comment