Home » Android » java – "Complete action using" when trying to load in a WebView

java – "Complete action using" when trying to load in a WebView

Posted by: admin May 14, 2020 Leave a comment


I’m testing the built-in WebView in the Android apps. My problem is that the following code

WebView webView = (WebView) findViewById(R.id.webView1);

triggers an intent (sugesting the installed browsers for opening the web) instead of open it in the built-in WebView. What should I do for avoiding that?

How to&Answers:
WebView mWebView= (WebView) findViewById(R.id.webView1);
mWebView.setWebViewClient(new WebViewClient() {
        public void onReceivedError(WebView view, int errorCode,
                String description, String failingUrl) {
            // Handle the error

        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return true;


This won’t open other broweser. Have reference here from DEVELOPER’s SITE.


You need to implement WebViewClient if you want to open URL within your application.

Check this link and find Handling Page Navigation for the WebViewClient example.