Browse Source

each subclass needs to call super.handleOnCreate

Rotem M 8 years ago
parent
commit
0ca7ab9815

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

174
         return rctManager.getReactInstanceManager();
174
         return rctManager.getReactInstanceManager();
175
     }
175
     }
176
 
176
 
177
+    @CallSuper
177
     protected void handleOnCreate() {
178
     protected void handleOnCreate() {
178
         if (getUseDeveloperSupport() && Build.VERSION.SDK_INT >= 23) {
179
         if (getUseDeveloperSupport() && Build.VERSION.SDK_INT >= 23) {
179
             // Get permission to show redbox in dev builds.
180
             // Get permission to show redbox in dev builds.
184
                 Toast.makeText(this, REDBOX_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show();
185
                 Toast.makeText(this, REDBOX_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show();
185
             }
186
             }
186
         }
187
         }
187
-
188
-        ReactRootView mReactRootView = createRootView();
189
-        mReactRootView.startReactApplication(mReactInstanceManager, getMainComponentName(), getLaunchOptions());
190
-        setContentView(mReactRootView);
191
     }
188
     }
192
 
189
 
193
     @Override
190
     @Override

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

46
 
46
 
47
     @Override
47
     @Override
48
     protected void handleOnCreate() {
48
     protected void handleOnCreate() {
49
+        super.handleOnCreate();
49
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
50
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
50
 
51
 
51
         setContentView(R.layout.bottom_tab_activity);
52
         setContentView(R.layout.bottom_tab_activity);

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

15
 
15
 
16
     @Override
16
     @Override
17
     protected void handleOnCreate() {
17
     protected void handleOnCreate() {
18
+        super.handleOnCreate();
18
         // Trigger react context initialization, global javascript code will now execute
19
         // Trigger react context initialization, global javascript code will now execute
19
         getReactInstanceManager().createReactContextInBackground();
20
         getReactInstanceManager().createReactContextInBackground();
20
     }
21
     }

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

23
 
23
 
24
     @Override
24
     @Override
25
     protected void handleOnCreate() {
25
     protected void handleOnCreate() {
26
+        super.handleOnCreate();
26
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
27
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
27
 
28
 
28
         setContentView(R.layout.single_screen_activity);
29
         setContentView(R.layout.single_screen_activity);

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

27
 
27
 
28
     @Override
28
     @Override
29
     protected void handleOnCreate() {
29
     protected void handleOnCreate() {
30
+        super.handleOnCreate();
30
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
31
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
31
 
32
 
32
         setContentView(R.layout.tab_activity);
33
         setContentView(R.layout.tab_activity);