Android SDK WebView call Activity
You could use WebView's addJavaScriptInterface to allow JavaScript to control your application (in this case, to allow JavaScript to fire an Intent when a link is clicked).
To do this you need to pass a class instance to bind to JavaScript, this could be something like the following:
private final class JsInterface {
public void launchIntent(final String payload) {
Activity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
// use the payload if you want, attach as an extra, switch destination, etc.
Activity.this.startActivity(new Intent(Activity.this, SomeOtherActivity.class));
}
});
}
}
Then you add that to the WebView with something along these lines:
webView.addJavascriptInterface(js, "Android");
Then in JavaScript from the WebView you just use your new "Android" object's "launchIntent" method.