diff --git a/app/src/main/java/com/example/app/MainActivity.java b/app/src/main/java/com/example/app/MainActivity.java index 264c404..8dc66bc 100755 --- a/app/src/main/java/com/example/app/MainActivity.java +++ b/app/src/main/java/com/example/app/MainActivity.java @@ -16,25 +16,19 @@ public class MainActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - mWebView = findViewById(R.id.activity_main_webview); - - // Force links and redirects to open in the WebView instead of in a browser mWebView.setWebViewClient(new WebViewClient()); - - // Enable Javascript WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); // REMOTE RESOURCE - // mWebView.loadUrl("http://example.com"); + // mWebView.loadUrl("https://example.com"); // mWebView.setWebViewClient(new MyWebViewClient()); // LOCAL RESOURCE // mWebView.loadUrl("file:///android_asset/index.html"); } - // Prevent the back-button from closing the app @Override public void onBackPressed() { if(mWebView.canGoBack()) { @@ -43,5 +37,4 @@ public class MainActivity extends Activity { super.onBackPressed(); } } - -} \ No newline at end of file +} diff --git a/app/src/main/java/com/example/app/MyWebViewClient.java b/app/src/main/java/com/example/app/MyWebViewClient.java index 0d41196..4253f6d 100755 --- a/app/src/main/java/com/example/app/MyWebViewClient.java +++ b/app/src/main/java/com/example/app/MyWebViewClient.java @@ -7,7 +7,6 @@ import android.webkit.WebViewClient; class MyWebViewClient extends WebViewClient { - @SuppressWarnings("deprecation") @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Uri uri = Uri.parse(url);