Reputation: 245
I call my file in my local storage in html format and display in webview. in my html contain a url which will click and display in the same webview. But when i call shouldOverrideUrlLoading is not working. Any help?
webview.loadUrl("file:///"+file);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new InsideWebViewClient());
private class InsideWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
}
Upvotes: 1
Views: 1595
Reputation: 429
Loading url with scheme like file:///android_asset
, and iframes
will not
trigger shouldOverrideUrlLoading
.
Upvotes: 1
Reputation: 3288
return true;
instead
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
Upvotes: 0