Browse Source

eventEmmiter lifecycle fix

Daniel Zlotin 8 years ago
parent
commit
e48804a88f

+ 1
- 2
android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java View File

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