From 45f1c58266a0d07dbc98974b602a10bf9ef06b29 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 27 Feb 2020 20:25:19 +0800 Subject: [PATCH] =?UTF-8?q?activity=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/top/jerryyan/RN/A/VersionUpgrade/UpgradeModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/top/jerryyan/RN/A/VersionUpgrade/UpgradeModule.java b/android/src/main/java/top/jerryyan/RN/A/VersionUpgrade/UpgradeModule.java index b92fa73..05a4675 100644 --- a/android/src/main/java/top/jerryyan/RN/A/VersionUpgrade/UpgradeModule.java +++ b/android/src/main/java/top/jerryyan/RN/A/VersionUpgrade/UpgradeModule.java @@ -23,7 +23,6 @@ public class UpgradeModule extends ReactContextBaseJavaModule { private String downloadUrl; private String title = "应用更新中"; - public UpgradeModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; @@ -51,6 +50,7 @@ public class UpgradeModule extends ReactContextBaseJavaModule { } private boolean _hasPermissionToInstall() { + Activity activity = reactContext.getCurrentActivity(); return activity != null && (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || activity.getPackageManager().canRequestPackageInstalls()); }