I have a Android Webview and when I click on a link to download a file (image of pdf etc) I got a error message.
Error message:
Cannot call determinedVisibil
This problem in my case produce by incorrect settings in layout properties. I had used:
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/webView"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="false"
android:layout_alignWithParentIfMissing="false" />
Instead of setting:
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/textView" />
The problems had been solved, when I removed "layout_alignParent" settings.
This is how I fixed a similar issue:
mWebView.setWebChromeClient(new WebChromeClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view,String url) {
return false;
}
});
mWebView.loadURL(...
Check whether internet permission is properly set on the Manifest file. Make sure that the permission tag should be outside of your Application tag.
<uses-permission android:name="android.permission.INTERNET" />
Hope this might help some one.
Just a bit of configuration:
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
I faced the same problem. I can fix my issue by giving this code:
webView.postDelayed(new Runnable() {
@Override
public void run() {
webView.loadUrl(url);
}
}, 500);
instead of:
webview.loadUrl(url);
then, set the url
starts with https://
I faced the same issue.
Was solved by giving a WebView a static height (ie 300dp) or specifying minHeight value.