android - WebView - load links in external browser -
I am loading content of a locally stored I have also tried: But in both cases, just try Or write this condition html file in a
WebView This file also contains a link in my app, when clicking, load
url in the same
WebView . I want to load these links instead of in an external browser. I have taken a look at
onPageStarted and
shouldOverrideUrl loading , but they do not work I have tried the following:
webAbout = ( WebView) findViewById (R.id.wvAbout); WebAbout.loadUrl (Const.defURL); WebAbout.setWebViewClient (New WebViewClient) {@Override Public Zero onPageStarted (for viewing WebView, string URL, bitmap favicon) {if (url.startsWith (Const.defURL)) {view.stopLoading (); // go Cheese} else {View.loadUrl (Const.defURL);}}});
webAbout = (WebView) findViewById (R.id.wvAbout); WebAbout.loadUrl (Const.defURL); WebAbout.setWebViewClient (New WebViewClient () {Public Boolean shouldOverrideUrlLoading (WebView to see, string URL) {if (url = Null & amp;! (Url.startsWith (Const.defURL)) {webAbout.loadUrl ( Const.defURL) Return;} and {view.getContext (.) StartActivity (New Intent (Intent.ACTION_VIEW, Uri.parse (url)) Return Return;}}});
WebView does not load anything, any ideas where I am getting wrong?
WebView = (WebView) findViewById (R .id.wvAbout); String url = ""; WebView.loadUrl (url);
if (urlPath .compareToIgnoreCase (Const.defURL) == 0) {} else {mWebView.setWebViewClient (New WebViewClient ( ) {@Override Public Boolean shouldOverrideUrlLoading (WebView to see, string URL) {view.clearView (); view.loadUrl (return);}}); }
Comments
Post a Comment