summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-10-11 09:12:43 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-10-11 22:44:27 (GMT)
commit56f674ac1d3ac580dfc13a85dfeef8d6d4069037 (patch)
treedfe5aebf01152f20a589b7834165dd5dc372dc6e /Xamarin.Forms.Platform.Android
parent52357e94466b6fcc4702ad3da04995c82be71393 (diff)
downloadxamarin-forms-56f674ac1d3ac580dfc13a85dfeef8d6d4069037.zip
xamarin-forms-56f674ac1d3ac580dfc13a85dfeef8d6d4069037.tar.gz
xamarin-forms-56f674ac1d3ac580dfc13a85dfeef8d6d4069037.tar.bz2
Checking IsDestroyed before using FragmentManager in Dispose() (#1194)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs2
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs7
2 files changed, 4 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
index faaf746..8c7059d 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailContainer.cs
@@ -138,7 +138,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
if (disposing)
{
- if (_currentFragment != null)
+ if (_currentFragment != null && !FragmentManager.IsDestroyed)
{
FragmentTransaction transaction = FragmentManager.BeginTransaction();
transaction.DisallowAddToBackStack();
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
index 09c5c49..e262c60 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
@@ -120,14 +120,13 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
{
_disposed = true;
- var activity = (FormsAppCompatActivity)Context;
-
// API only exists on newer android YAY
if ((int)Build.VERSION.SdkInt >= 17)
{
- if (!activity.IsDestroyed)
+ FragmentManager fm = FragmentManager;
+
+ if (!fm.IsDestroyed)
{
- FragmentManager fm = FragmentManager;
FragmentTransaction trans = fm.BeginTransaction();
foreach (Fragment fragment in _fragmentStack)
trans.Remove(fragment);