If there is Google Play in the entered URL, I want it to open from the external market.
If not, I want it to open normally. My code is as follows, where is the error? Can you help me?
my code : private class Myweb extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request)
{
if (request.getUrl().toString().contains("play.google"))
{
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(request.getUrl().toString()));
startActivity(intent);
}else {
view.loadUrl(request.getUrl().toString());
}
return true;
}
}
if it opens a play market url, I want it to open in chrome browser. no, if it opens another url, I want it to open normally in webview i couldn't find my mistake.