I am working on an application which uses web view in one of it\'s activities. I have attached a java script interface with the web content. I need to call an activity with
You can use the WebView OnClick to check which link was clicked and take action accordingly. Like this:
wv.setOnClickListener(new OnClickListener() {
public boolean onClick(View v){
HitTestResult result = wv.getHitTestResult();
String url = result.getExtra();
//Log.i(myTag, url);
if(url.equals("which-ever-url-you-want-to-override.com"){
Intent i = new Intent(getApplicationContext(), yourActivity.class);
startActivity(i);
}
}
});
getHitTestResult() will give you an object that will tell you where the URL of the link points. You can use this to make different links do different things within your app.