Kaynağa Gözat

each subclass needs to call super.handleOnCreate

Rotem M 8 yıl önce
ebeveyn
işleme
0ca7ab9815

+ 1
- 4
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java Dosyayı Görüntüle

@@ -174,6 +174,7 @@ public abstract class BaseReactActivity extends AppCompatActivity implements Def
174 174
         return rctManager.getReactInstanceManager();
175 175
     }
176 176
 
177
+    @CallSuper
177 178
     protected void handleOnCreate() {
178 179
         if (getUseDeveloperSupport() && Build.VERSION.SDK_INT >= 23) {
179 180
             // Get permission to show redbox in dev builds.
@@ -184,10 +185,6 @@ public abstract class BaseReactActivity extends AppCompatActivity implements Def
184 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 190
     @Override

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java Dosyayı Görüntüle

@@ -46,6 +46,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
46 46
 
47 47
     @Override
48 48
     protected void handleOnCreate() {
49
+        super.handleOnCreate();
49 50
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
50 51
 
51 52
         setContentView(R.layout.bottom_tab_activity);

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/RootActivity.java Dosyayı Görüntüle

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

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java Dosyayı Görüntüle

@@ -23,6 +23,7 @@ public class SingleScreenActivity extends BaseReactActivity {
23 23
 
24 24
     @Override
25 25
     protected void handleOnCreate() {
26
+        super.handleOnCreate();
26 27
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
27 28
 
28 29
         setContentView(R.layout.single_screen_activity);

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/activities/TabActivity.java Dosyayı Görüntüle

@@ -27,6 +27,7 @@ public class TabActivity extends BaseReactActivity {
27 27
 
28 28
     @Override
29 29
     protected void handleOnCreate() {
30
+        super.handleOnCreate();
30 31
         mReactInstanceManager = RctManager.getInstance().getReactInstanceManager();
31 32
 
32 33
         setContentView(R.layout.tab_activity);