I tried to set my webview to open more than one link, but it does not work
My code causes websites.google to open in the app's webview and the rest of the links open outside (android nav), I want sites.google and photos.google to open in the app's webview
private class MyWebviewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Uri.parse(url).getHost().equals("sites.google.com")) {
//abrir no meu webview AQUI EU GOSTARIA DE ADC OUTRO
return false; LINK PARA ABRIR NO MEU WV
} else {
//restante dos links abrir no navegador
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
}
An example
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Uri.parse(url).getHost().equals("sites.google.com") && ("photos.google.com")) {
But this does not work, can you do that? If so, does anyone know another way?