Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
OnAppearing gets invoked when App comes to foreground in Android in a view hierarchy of either:
1. NavigationPage's child -> TabbedPage's child-> Page1, Page1's OnAppearing will be invoked when Android comes to the foreground.
1. TabbedPage child -> NavigationPage child -> Page1, Page1's OnAppearing will be invoked when Android comes to the foreground.
Same applies to OnDisappearing when Android App goes to background.
The OnAppearing and OnDisappearing should not be invoked when App goes to background or foreground.
Test Project is attached.
iOS and Android have been inconsistent for a long time. I do not think this will change. For example, we can't start triggering appearing / disappearing events for iOS all of a sudden and break compatibility.
If you want consistency, you can disable these events for Android and use pub/sub in app sleep / resume for cross platform approach.
You can use SendAppearingEventOnResume / SendDisappearingEventOnPause platform-specific options to turn on and off these events on Android.
If you publish app sleep / resume event, which method in Page1 would you subscribe? If Page1 subscribes "AppResume" in OnAppearing and unsubscribe it in OnDisappearing, then you will never receive the event as OnAppearing invoked after App sends out "AppResume". However, if you subscribe "AppResume" in Page1's constructer method, then it will cause memory problem as "AppResume" event can never be unsubscribed. So even Page1 gets popped out, it will still receive the event
I would redirect you to this thread on the Forms evolution forum for discussion about potential lifecycle changes: https://forums.xamarin.com/discussion/84510/improved-life-cycle-support#latest