uri.getHost() can be null if the user clicks on mailto: links and phone numbers
This commit is contained in:
parent
11dd5784e5
commit
0fe0748d09
@ -9,7 +9,8 @@ public class MyWebViewClient extends WebViewClient {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (Uri.parse(url).getHost().endsWith("example.com")) {
|
Uri uri = Uri.parse(url);
|
||||||
|
if (uri.getHost() != null && uri.getHost().contains("example.com")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user