Android WebView click open within WebView not a default browser

后端 未结 12 2006
迷失自我
迷失自我 2020-11-27 16:34

I did one sample application using WebView, in that web view the URL comes from web services. It\'s working fine, but if I click any link within that WebView, its automatica

12条回答
  •  -上瘾入骨i
    2020-11-27 17:22

    You have to set up a webViewClient for your webView.

    Sample:

    this.mWebView.setWebViewClient(new WebViewClient(){
    
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url){
          view.loadUrl(url);
          return true;
        }
    });
    

提交回复
热议问题