Browse Source

fixed init of EventEmitter

Daniel Zlotin 8 years ago
parent
commit
1d579efccd

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

65
     }
65
     }
66
 
66
 
67
     public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
67
     public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
68
-        reactEventEmitter = new NavigationReactEventEmitter(getReactContext());
69
         getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
68
         getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
70
     }
69
     }
71
 
70
 
77
         return host;
76
         return host;
78
     }
77
     }
79
 
78
 
79
+    //TODO temp hack
80
+    void onReactContextInitialized() {
81
+        reactEventEmitter = new NavigationReactEventEmitter(getReactContext());
82
+    }
80
 
83
 
81
     private static class ReactNativeHostImpl extends ReactNativeHost implements ReactInstanceManager.ReactInstanceEventListener {
84
     private static class ReactNativeHostImpl extends ReactNativeHost implements ReactInstanceManager.ReactInstanceEventListener {
82
 
85
 
135
 
138
 
136
         @Override
139
         @Override
137
         public void onReactContextInitialized(ReactContext context) {
140
         public void onReactContextInitialized(ReactContext context) {
141
+            ((NavigationReactGateway) NavigationApplication.instance.getReactGateway()).onReactContextInitialized();
138
             NavigationApplication.instance.onReactInitialized(context);
142
             NavigationApplication.instance.onReactInitialized(context);
139
         }
143
         }
140
 
144