How Can I Load A Link In Other Browser From Web View?
I am loading string value in my web view and i need when i click on the link shown in web view should open in other web browser of phone. I want like this - String s = 'hello read
Solution 1:
Try this:
webView.setWebViewClient(newWebViewClient(){
publicbooleanshouldOverrideUrlLoading(WebView view, String url) {
if (url != null && (url.startsWith("http://") || url.startsWith("https://"))) {
view.getContext().startActivity(
newIntent(Intent.ACTION_VIEW, Uri.parse(url)));
returntrue;
} else {
returnfalse;
}
}
});
Post a Comment for "How Can I Load A Link In Other Browser From Web View?"