Android Webview: Cannot call determinedVisibility() - never saw a connection for the pid

前端 未结 11 884
南笙
南笙 2020-12-01 14:11

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         


        
相关标签:
11条回答
  • 2020-12-01 14:20

    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.

    0 讨论(0)
  • 2020-12-01 14:21

    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(...
    
    0 讨论(0)
  • 2020-12-01 14:21

    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.

    0 讨论(0)
  • 2020-12-01 14:24

    Just a bit of configuration:

        webview.getSettings().setJavaScriptEnabled(true);
        webview.getSettings().setDomStorageEnabled(true);
    
    0 讨论(0)
  • 2020-12-01 14:28

    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://

    0 讨论(0)
  • 2020-12-01 14:29

    I faced the same issue.

    Was solved by giving a WebView a static height (ie 300dp) or specifying minHeight value.

    0 讨论(0)
提交回复
热议问题