Browse Source

Fix FragmentScreen not getting unmount

fixes #330
Guy Carmeli 8 years ago
parent
commit
3c2b0ea5cc

+ 3
- 2
android/app/src/main/java/com/reactnativenavigation/screens/FragmentScreen.java View File

@@ -25,6 +25,7 @@ public class FragmentScreen extends Screen {
25 25
     private static final String CONTRACT_GET_FRAGMENT = "getFragment";
26 26
     private static final String CONTRACT_GET_SUPPORT_FRAGMENT = "getSupportFragment";
27 27
     private FrameLayout content;
28
+    private ContentView contentView;
28 29
 
29 30
     public FragmentScreen(AppCompatActivity activity, ScreenParams screenParams, LeftButtonOnClickListener leftButtonOnClickListener) {
30 31
         super(activity, screenParams, leftButtonOnClickListener);
@@ -39,7 +40,7 @@ public class FragmentScreen extends Screen {
39 40
     }
40 41
 
41 42
     private void addContent() {
42
-        ContentView contentView = new ContentView(getContext(),
43
+        contentView = new ContentView(getContext(),
43 44
                 screenParams.screenId,
44 45
                 screenParams.navigationParams);
45 46
         addView(contentView, 0, 0);
@@ -110,7 +111,7 @@ public class FragmentScreen extends Screen {
110 111
 
111 112
     @Override
112 113
     public void unmountReactView() {
113
-        // nothing
114
+        contentView.unmountReactView();
114 115
     }
115 116
 
116 117
     @Override