Quellcode durchsuchen

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 vor 8 Jahren
Ursprung
Commit
760292b742

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java Datei anzeigen

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