From 37ec256891a411c559aab73fa18d7412cd61c1c5 Mon Sep 17 00:00:00 2001 From: slymax Date: Tue, 22 Jan 2019 12:43:24 +0100 Subject: [PATCH] minor fixes --- README.md | 2 +- app/src/main/java/com/example/app/MyWebViewClient.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b05c18f..b5a39cd 100755 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you want to create an app that displays the content of a remote website mWebView.setWebViewClient(new MyWebViewClient()); ``` -2. open the `MyWebViewClient.java` file and replace `example.com` on line **14** with your custom hostname +2. open the `MyWebViewClient.java` file and replace `example.com` on line **15** with your custom hostname ```java if (Objects.requireNonNull(Uri.parse(url).getHost()).endsWith("example.com")) { diff --git a/app/src/main/java/com/example/app/MyWebViewClient.java b/app/src/main/java/com/example/app/MyWebViewClient.java index dc10ce9..6b528e8 100755 --- a/app/src/main/java/com/example/app/MyWebViewClient.java +++ b/app/src/main/java/com/example/app/MyWebViewClient.java @@ -9,6 +9,7 @@ import java.util.Objects; class MyWebViewClient extends WebViewClient { + @SuppressWarnings("deprecation") @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (Objects.requireNonNull(Uri.parse(url).getHost()).endsWith("example.com")) {