Better WebView present test

This commit is contained in:
M66B
2018-11-26 15:54:38 +01:00
parent 953531de5e
commit b0362207fe
3 changed files with 7 additions and 10 deletions

View File

@@ -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 =

View File

@@ -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");
}