aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorHermes Junior <ohermesjunior@gmail.com>2020-06-09 11:41:03 +0000
committerOHermesJunior <ohermesjunior@gmail.com>2020-06-09 11:41:03 +0000
commit3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d (patch)
tree95e4fd9897c034a2bc1356bdc63321387c476d55 /app/src/main/java/ml
parent9a47a3d9d20c061e38161293498622e3a6aaf8b5 (diff)
downloadinfinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar.gz
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar.bz2
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar.lz
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar.xz
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.tar.zst
infinity-for-reddit-3cd7cbd6d80debba40df4df5fcf2abfd13a0ee9d.zip
Fail gracefully when there is no webview installed.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
index 7f03f302..f67893fd 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
@@ -6,6 +6,8 @@ import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
+import android.util.Log;
+import android.view.InflateException;
import android.view.MenuItem;
import android.webkit.CookieManager;
import android.webkit.WebView;
@@ -70,7 +72,14 @@ public class LoginActivity extends BaseActivity {
((Infinity) getApplication()).getAppComponent().inject(this);
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_login);
+ try {
+ setContentView(R.layout.activity_login);
+ } catch (InflateException ie) {
+ Log.e("LoginActivity", "Failed to inflate LoginActivity: " + ie.getMessage());
+ Toast.makeText(LoginActivity.this, R.string.no_system_webview_error, Toast.LENGTH_SHORT).show();
+ finish();
+ return;
+ }
ButterKnife.bind(this);