Improved WebView test

This commit is contained in:
M66B
2019-01-27 17:48:41 +00:00
parent 7758cdf2c6
commit 83931fabec
3 changed files with 16 additions and 13 deletions

View File

@@ -44,6 +44,7 @@ import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
@@ -861,6 +862,19 @@ public class Helper {
}
}
static boolean hasWebView(Context context) {
PackageManager pm = context.getPackageManager();
if (pm.hasSystemFeature("android.software.webview"))
try {
new WebView(context);
return true;
} catch (Throwable ex) {
return false;
}
else
return false;
}
public static String getFingerprint(Context context) {
try {
PackageManager pm = context.getPackageManager();