Browse Source

Fixed ReactInstanceManager not getting destroyed when app moves to background

This bug caused app to start in white screen after it was relaunched since index file had already
run once.
Guy Carmeli 8 years ago
parent
commit
760292b742

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java View File

195
 
195
 
196
         // Destroy react instance manager only if there are no resumed react activities
196
         // Destroy react instance manager only if there are no resumed react activities
197
         BaseReactActivity activity = ContextProvider.getActivityContext();
197
         BaseReactActivity activity = ContextProvider.getActivityContext();
198
-        if (mReactInstanceManager != null && activity != null && activity.isFinishing()) {
198
+        if (mReactInstanceManager != null && (activity == null || activity.isFinishing())) {
199
             Log.i(TAG, "Destroying ReactInstanceManager");
199
             Log.i(TAG, "Destroying ReactInstanceManager");
200
             mReactInstanceManager.onDestroy();
200
             mReactInstanceManager.onDestroy();
201
         } else {
201
         } else {