mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 01:36:55 +00:00
Check if webview exists
This commit is contained in:
parent
845484fa80
commit
b0fa5acf7b
2 changed files with 10 additions and 0 deletions
|
@ -557,6 +557,7 @@ public class FragmentMessage extends FragmentEx {
|
|||
menu.findItem(R.id.menu_show_headers).setChecked(headers);
|
||||
menu.findItem(R.id.menu_show_headers).setEnabled(message.uid != null);
|
||||
menu.findItem(R.id.menu_show_headers).setVisible(!free);
|
||||
menu.findItem(R.id.menu_show_html).setEnabled(Helper.classExists("android.webkit.WebView"));
|
||||
menu.findItem(R.id.menu_reply_all).setVisible(!inOutbox);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,6 +124,15 @@ public class Helper {
|
|||
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
||||
}
|
||||
|
||||
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…
Reference in a new issue