Skip to main content
added 520 characters in body
Source Link
filthy_wizard
  • 740
  • 12
  • 27

say you get the url sent as a string "www.google.com", from the edittext just do a check if this is a blocked url. for example

if( "www.google.com".equalsIgnoreCase(blocked_string)) { webview.setVisibility(View.GONE); warning_view.setVisibilty(View.VISIBLE); } 

or you could try overriding the shouldOverrideUrlLoading() in the WebViewClient class

@Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(my_url.equals("www.google.com")){ //do something. } return true; } 

Creating and setting a WebViewClient subclass. It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL loading here (via shouldOverrideUrlLoading()).

say you get the url sent as a string "www.google.com", from the edittext just do a check if this is a blocked url. for example

if( "www.google.com".equalsIgnoreCase(blocked_string)) { webview.setVisibility(View.GONE); warning_view.setVisibilty(View.VISIBLE); } 

say you get the url sent as a string "www.google.com", from the edittext just do a check if this is a blocked url. for example

if( "www.google.com".equalsIgnoreCase(blocked_string)) { webview.setVisibility(View.GONE); warning_view.setVisibilty(View.VISIBLE); } 

or you could try overriding the shouldOverrideUrlLoading() in the WebViewClient class

@Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(my_url.equals("www.google.com")){ //do something. } return true; } 

Creating and setting a WebViewClient subclass. It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL loading here (via shouldOverrideUrlLoading()).

Source Link
filthy_wizard
  • 740
  • 12
  • 27

say you get the url sent as a string "www.google.com", from the edittext just do a check if this is a blocked url. for example

if( "www.google.com".equalsIgnoreCase(blocked_string)) { webview.setVisibility(View.GONE); warning_view.setVisibilty(View.VISIBLE); }