From 346706e0214f4d552e9b3ef63856315c8de63933 Mon Sep 17 00:00:00 2001 From: Mike Diarmid Date: Fri, 5 Jul 2019 07:52:21 +0100 Subject: [PATCH] [android] support Application in PackageList --- packages/platform-android/native_modules.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/platform-android/native_modules.gradle b/packages/platform-android/native_modules.gradle index 4bd826f76..84f5e1683 100644 --- a/packages/platform-android/native_modules.gradle +++ b/packages/platform-android/native_modules.gradle @@ -17,10 +17,16 @@ import java.util.ArrayList; {{ packageImports }} public class PackageList { + private Application application; private ReactNativeHost reactNativeHost; public PackageList(ReactNativeHost reactNativeHost) { this.reactNativeHost = reactNativeHost; } + + public PackageList(Application application) { + this.reactNativeHost = null; + this.application = application; + } private ReactNativeHost getReactNativeHost() { return this.reactNativeHost; @@ -31,6 +37,7 @@ public class PackageList { } private Application getApplication() { + if (this.reactNativeHost == null) return this.application; return this.reactNativeHost.getApplication(); }