Przeglądaj źródła

eventEmmiter lifecycle fix

Daniel Zlotin 8 lat temu
rodzic
commit
e48804a88f

+ 1
- 2
android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java Wyświetl plik

@@ -67,13 +67,11 @@ public class NavigationReactGateway implements ReactGateway, ReactInstanceManage
67 67
     public void onPause() {
68 68
         reactInstanceManager.onHostPause();
69 69
         onJsDevReloadListener = null;
70
-        reactEventEmitter = null;
71 70
     }
72 71
 
73 72
     public void onResume(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler, OnJsDevReloadListener onJsDevReloadListener) {
74 73
         this.onJsDevReloadListener = onJsDevReloadListener;
75 74
         reactInstanceManager.onHostResume(activity, defaultHardwareBackBtnHandler);
76
-        reactEventEmitter = new NavigationReactEventEmitter(reactInstanceManager.getCurrentReactContext());
77 75
     }
78 76
 
79 77
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -139,6 +137,7 @@ public class NavigationReactGateway implements ReactGateway, ReactInstanceManage
139 137
 
140 138
     @Override
141 139
     public void onReactContextInitialized(ReactContext context) {
140
+        reactEventEmitter = new NavigationReactEventEmitter(context);
142 141
         NavigationApplication.instance.onReactInitialized(context);
143 142
     }
144 143
 }