Browse Source

Close Modal on back press

Guy Carmeli 8 years ago
parent
commit
cd3f1d2b97

+ 5
- 1
android/app/src/main/java/com/reactnativenavigation/modal/RnnModal.java View File

@@ -88,7 +88,11 @@ public class RnnModal extends Dialog implements DialogInterface.OnDismissListene
88 88
 
89 89
     @Override
90 90
     public void onBackPressed() {
91
-        pop();
91
+        if (mScreenStack.getStackSize() == 1) {
92
+            super.onBackPressed();
93
+        } else {
94
+            pop();
95
+        }
92 96
     }
93 97
 
94 98
     @Override