Maybe.
You must declare a Javascript interface as follows:
private class MyJSI {
public void doStuff()
{
}
}
And link your webview to the Javascript interface as follows:
webView.addJavascriptInterface(new MyJSI(), "myjsi");
Then you need to write javascript code when loading the page to call the doStuff function when the hash changes.
webview.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url)
{
view.loadUrl("javascript:window.onhashchange = function() { myjsi.doStuff(); };");
}
});
Hope this helps. I tested it and it works.
source
share