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