summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-08-22 13:55:49 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-08-29 13:42:35 (GMT)
commitb0a6d74e1e7746ab3605c91d1ae48b2b67325d18 (patch)
tree771e6cac15623c61e1880cce3e45abcb12d5b284 /Xamarin.Forms.Platform.Android
parentddbe24917048341d0958693ebae0b58fc282305d (diff)
downloadxamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.zip
xamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.tar.gz
xamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.tar.bz2
Fix NRE when removing multiple pages in NavigationPageRenderer (#1108)
* Update 53179 test to remove 2 pages; fix for NRE when removing two pages with Android Support 25+ * Add missing step to UI test
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs17
1 files changed, 5 insertions, 12 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
index 7a4e478..09c5c49 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
@@ -569,6 +569,11 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
return;
}
+#if DEBUG
+ // Enables logging of moveToState operations to logcat
+ FragmentManager.EnableDebugLogging(true);
+#endif
+
// Go ahead and take care of the fragment bookkeeping for the page being removed
FragmentTransaction transaction = FragmentManager.BeginTransaction();
transaction.DisallowAddToBackStack();
@@ -578,18 +583,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
// And remove the fragment from our own stack
_fragmentStack.Remove(fragment);
- // Now handle all the XF removal/cleanup
- IVisualElementRenderer rendererToRemove = Android.Platform.GetRenderer(page);
-
- if (rendererToRemove != null)
- {
- var containerToRemove = (PageContainer)rendererToRemove.View.Parent;
- rendererToRemove.View?.RemoveFromParent();
- rendererToRemove?.Dispose();
- containerToRemove?.RemoveFromParent();
- containerToRemove?.Dispose();
- }
-
Device.StartTimer(TimeSpan.FromMilliseconds(10), () =>
{
UpdateToolbar();