summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
index fad745aa..0265cd3d 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
@@ -71,7 +71,10 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
transaction.DisallowAddToBackStack();
transaction.Remove(_currentFragment);
transaction.SetTransition((int)FragmentTransit.None);
- transaction.Commit();
+
+ // This is a removal of a fragment that's not going on the back stack; there's no reason to care
+ // whether its state gets successfully saved, since we'll never restore it. Ergo, CommitAllowingStateLoss
+ transaction.CommitAllowingStateLoss();
_currentFragment = null;
}
@@ -102,7 +105,10 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
transaction.Add(Id, fragment);
transaction.SetTransition((int)FragmentTransit.None);
- transaction.Commit();
+
+ // We don't currently support fragment restoration
+ // So we don't need to worry about loss of this fragment's state
+ transaction.CommitAllowingStateLoss();
_currentFragment = fragment;