simplify config
This commit is contained in:
@ -9,8 +9,10 @@ class MyWebViewClient extends WebViewClient {
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
String hostname;
|
||||
hostname = "example.com";
|
||||
Uri uri = Uri.parse(url);
|
||||
if (url.startsWith("file:") || uri.getHost() != null && uri.getHost().endsWith("example.com")) {
|
||||
if (url.startsWith("file:") || uri.getHost() != null && uri.getHost().endsWith(hostname)) {
|
||||
return false;
|
||||
}
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
|
Reference in New Issue
Block a user