android studio - webview shouldOverrideUrlLoading multiple url -
i'm trying load 2 different url in webview, seems went wrong or maybe webview not allow override multiple url in single webview?. first url site url, second 1 community facebook page, first 1 opened in webview not other one. codes:
@override public boolean shouldoverrideurlloading(webview view, string url) { if (uri.parse(url).gethost().equals("mysite.com")){ return false; } else if (uri.parse(url).gethost().equals("facebook.com")){ return false; } else { intent intent = new intent(intent.action_view, uri.parse(url)); startactivity(intent); return true; } }
and first attempt, second is:
@override public boolean shouldoverrideurlloading(webview view, string url) { if ((uri.parse(url).gethost().equals("mysite.com"))|| (uri.parse(url).gethost().equals("facebook.com"))){ return false; } else { intent intent = new intent(intent.action_view, uri.parse(url)); startactivity(intent); return true; } }
i tried replace facebook url site url still no luck. new android explanations appreciated, thank in advance..
err, maybe problem inside here? since loadurl load mysite url , not other url?:
mwebview.loadurl("mysite full url"); //handle link inside app mwebview.setwebviewclient(new mywebviewclient());
Comments
Post a Comment