Daniel Zlotin před 8 roky
rodič
revize
0f75f7155d

+ 6
- 0
android/app/src/main/java/com/reactnativenavigation/activities/NavigationActivity.java Zobrazit soubor

27
 public class NavigationActivity extends AppCompatActivity implements NavigationReactInstance.ReactContextCreator, DefaultHardwareBackBtnHandler {
27
 public class NavigationActivity extends AppCompatActivity implements NavigationReactInstance.ReactContextCreator, DefaultHardwareBackBtnHandler {
28
 
28
 
29
     private NavigationReactInstance navigationReactInstance;
29
     private NavigationReactInstance navigationReactInstance;
30
+    /**
31
+     * Although we start multiple activities, we make sure to pass Intent.CLEAR_TASK | Intent.NEW_TASK
32
+     * So that we actually have only 1 instance of the activity running at one time.
33
+     * We hold the currentActivity (resume->pause) so we know when we need to destroy the javascript context.
34
+     * This is somewhat weird, and in the future either fully support multiple activities, OR a single activity with changing contentView ala ReactNative impl.
35
+     */
30
     private static Activity currentActivity;
36
     private static Activity currentActivity;
31
 
37
 
32
     @Override
38
     @Override