diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-08-22 07:55:49 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-08-29 14:42:35 +0100 |
commit | b0a6d74e1e7746ab3605c91d1ae48b2b67325d18 (patch) | |
tree | 771e6cac15623c61e1880cce3e45abcb12d5b284 /Xamarin.Forms.Platform.Android | |
parent | ddbe24917048341d0958693ebae0b58fc282305d (diff) | |
download | xamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.tar.gz xamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.tar.bz2 xamarin-forms-b0a6d74e1e7746ab3605c91d1ae48b2b67325d18.zip |
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.cs | 17 |
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 7a4e4788..09c5c49b 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(); |