Abdullah Abdullah - 26 days ago 23
Android Question

Denied starting an intent without a user gesture Webview Android

Trying to redirect local html page in android webview using Javascript redirect, gets denied starting an intent in Logcat:


Testing on android 5.1.1


document.location = "index.html";


Denied starting an intent without a user gesture, URI:

file:///android_asset/index.html

Answer

I read the documentation in 1,000 attempts Android.developer and this was my solution

I do not know if you understand, I speak Spanish

webView.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        return false;                
    }
});
Comments