Browse Source

Dismiss all modals when starting new activity

When starting new activity after previous activity showed modals
and did not dismiss them. The modal controller still had
registered modals even though we can't go back in the activity stack.
Guy Carmeli 8 years ago
parent
commit
88ad3c81eb

+ 6
- 0
android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java View File

57
             if(ContextProvider.getActivityContext() instanceof RootActivity) {
57
             if(ContextProvider.getActivityContext() instanceof RootActivity) {
58
                 context.overridePendingTransition(0, 0);
58
                 context.overridePendingTransition(0, 0);
59
             }
59
             }
60
+
61
+            // Dismiss modals associated with previous activity
62
+            ModalController.getInstance().dismissAllModals();
60
         }
63
         }
61
     }
64
     }
62
 
65
 
83
             if(ContextProvider.getActivityContext() instanceof RootActivity) {
86
             if(ContextProvider.getActivityContext() instanceof RootActivity) {
84
                 context.overridePendingTransition(0, 0);
87
                 context.overridePendingTransition(0, 0);
85
             }
88
             }
89
+
90
+            // Dismiss modals associated with previous activity
91
+            ModalController.getInstance().dismissAllModals();
86
         }
92
         }
87
     }
93
     }
88
 
94