BooDoo BooDoo - 5 months ago 17
Android Question

Block a site in webview

In my apps webview i want to block some sites that users should not enter. For example how can i block all google sites (.com .fr etc.) without using


because some urls contain the word google but they dont browse to the site. For example:

Here is my code

web.setWebViewClient(new WebViewClient(){

public void onPageStarted(WebView webView, String webUrl, Bitmap favicon) {

if(webUrl.contains("google")){//not works good

super.onPageStarted(webView, webUrl, favicon);




Use this hope it helps

//block site

You don't need to do something more from that