When Android loads a web page, some mobile phones will pop up the browser that comes with the phone. Solution

Today, some users reported that when browsing information, a pop-up message will pop up and they need to choose the browser that comes with the phone to view it. What is going on? ? Then we tested and found that most mobile phones still wouldn't have this problem, but some mobile phones in the company also had this problem, so the bug was fixed and the code was submitted.

 webview.getSettings().setJavaScriptEnabled(true);
        webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        webview.getSettings().setSupportMultipleWindows(true);
        webview.setWebViewClient(new WebViewClient());
        webview.setWebChromeClient(new WebChromeClient());
        prMyloading.setVisibility(View.GONE);
        webview.loadUrl(url);
        //这里的URL就是项目中加载web页的地址,大家自己写就可以了

Change it to the above code and it will be OK, the problem is solved

Guess you like

Origin blog.csdn.net/qq_42221857/article/details/103298148