mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Prevent crash
This commit is contained in:
parent
4933138276
commit
900348b9d8
1 changed files with 14 additions and 6 deletions
|
@ -371,16 +371,24 @@ public class Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean hasWebView(Context context) {
|
static boolean hasWebView(Context context) {
|
||||||
PackageManager pm = context.getPackageManager();
|
try {
|
||||||
if (pm.hasSystemFeature(PackageManager.FEATURE_WEBVIEW))
|
PackageManager pm = context.getPackageManager();
|
||||||
try {
|
if (pm.hasSystemFeature(PackageManager.FEATURE_WEBVIEW)) {
|
||||||
new WebView(context);
|
new WebView(context);
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable ex) {
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
} catch (Throwable ex) {
|
||||||
else
|
/*
|
||||||
|
Caused by: java.lang.RuntimeException: Package manager has died
|
||||||
|
at android.app.ApplicationPackageManager.hasSystemFeature(ApplicationPackageManager.java:414)
|
||||||
|
at eu.faircode.email.Helper.hasWebView(SourceFile:375)
|
||||||
|
at eu.faircode.email.ApplicationEx.onCreate(SourceFile:110)
|
||||||
|
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
|
||||||
|
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4751)
|
||||||
|
*/
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean canPrint(Context context) {
|
static boolean canPrint(Context context) {
|
||||||
|
|
Loading…
Reference in a new issue