Better WebView present test

pull/146/head
M66B 7 years ago
parent 953531de5e
commit b0362207fe

@ -11,9 +11,13 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.vending.BILLING" />
<!-- https://developer.android.com/guide/topics/manifest/uses-feature-element#features-reference -->
<uses-feature
android:name="android.software.app_widgets"
android:required="false" />
<uses-feature
android:name="android.software.webview"
android:required="false" />
<application
android:name=".ApplicationEx"

@ -1513,7 +1513,9 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
this.dp24 = Math.round(24 * context.getResources().getDisplayMetrics().density);
this.theme = prefs.getString("theme", "light");
this.hasWebView = Helper.classExists("android.webkit.WebView");
PackageManager pm = context.getPackageManager();
this.hasWebView = pm.hasSystemFeature("android.software.webview");
}
private static final DiffUtil.ItemCallback<TupleMessageEx> DIFF_CALLBACK =

@ -187,15 +187,6 @@ public class Helper {
return new DecimalFormat("@@").format(bytes / Math.pow(unit, exp)) + " " + pre + "B";
}
static boolean classExists(String className) {
try {
Class.forName(className);
return true;
} catch (ClassNotFoundException ignored) {
return false;
}
}
static Address myAddress() throws UnsupportedEncodingException {
return new InternetAddress("marcel+fairemail@faircode.eu", "FairCode");
}

Loading…
Cancel
Save