diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2016-09-30 13:57:28 -0500 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-09-30 11:57:28 -0700 |
commit | 353525e293716d16c74741c96ed1bcd628c24363 (patch) | |
tree | aa1710eb1be9bccc7ec7a2412157fc62babc1e34 /Xamarin.Forms.Platform.Android/AppCompat | |
parent | fa2f01680d23a813a5b1ab7795151b6dcb0feb7f (diff) | |
download | xamarin-forms-353525e293716d16c74741c96ed1bcd628c24363.tar.gz xamarin-forms-353525e293716d16c74741c96ed1bcd628c24363.tar.bz2 xamarin-forms-353525e293716d16c74741c96ed1bcd628c24363.zip |
[Android] Forward appearing / disappearing methods only for the last item on the stack (#342)
* [Android] Forward appearing / disappearing methods only for the last item on the stack
* use tabs
Diffstat (limited to 'Xamarin.Forms.Platform.Android/AppCompat')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/FragmentContainer.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FragmentContainer.cs b/Xamarin.Forms.Platform.Android/AppCompat/FragmentContainer.cs index 62e43809..c44d711f 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/FragmentContainer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/FragmentContainer.cs @@ -119,14 +119,19 @@ namespace Xamarin.Forms.Platform.Android.AppCompat public override void OnPause() { - PageController?.SendDisappearing(); + Page currentPage = (Application.Current.MainPage as IPageContainer<Page>)?.CurrentPage; + if (currentPage == null || currentPage == PageController) + PageController?.SendDisappearing(); + base.OnPause(); } public override void OnResume() { - if (UserVisibleHint) - PageController?.SendAppearing(); + Page currentPage = (Application.Current.MainPage as IPageContainer<Page>)?.CurrentPage; + if (UserVisibleHint && (currentPage == null || currentPage == PageController)) + PageController?.SendAppearing(); + base.OnResume(); } } |