I am making an e-book reader program that uses the epub format to load books in webviews. Some books have reference to some parts in the same chapter. Each chapter is loaded as html. This is how the link looks
file:///storage/sdcard0/Android/data/com.abc.reader/files/Download/498935/epub/resources/498935/OEBPS/
I tried using the shouldOverrideUrlLoading() method to get the callback, but it will not be called, and when I click the links in onPageFinished , the url is shown as about:blank
reader.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.w("TESTTESTOVERRIDE "+url); view.loadUrl(url); return false; } @Override public void onPageFinished(WebView view, String url) {
Any ideas?
EDIT: on 4.1 devices, I am linking correctly, but in 4.4 or 5.0 it is roughly: empty. (in both cases shouldOverrideUrlLoading not called)
javascript android anchor android-webview
shine_joseph
source share