For example im doing the next catching a URL in my WebView over Android;
In the your Method shouldOverrideUrlLoading:
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
webView.getUrl();
if( url.equals("http://any.com/url") ){
//Do any action
Toast tr =Toast.makeText(WebViewTest.this, "Test Passed", Toast.LENGTH_LONG);
tr.show();
//Go to other activity or you can put finish(); to stop the actual activity
//Do other action
Intent i1 = new Intent("com.mypack.courses.Passed");
startActivity(i1);;
return true;
}
if( url.equals("http://any.com/url") ){
Toast tr =Toast.makeText(WebViewTest.this, "Test Failed", Toast.LENGTH_LONG);
tr.show();
Intent i2 = new Intent("com.mypack.courses.Failed");
startActivity(i2);
return true;
}
return true;
}
in this case, if the user click in the ""http://any.com/url" over the Webview, we do any actions, just put your conditions or methods, and wherever you want to do there, hope this give you ideas...