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.
Currently as of Xamarin.Forms 1.3, we have lifecycle methods such as OnStart(), OnSleep(), and OnResume(). These methods however do not fully translate within Android's Lifecycle and thus can cause some unexpected behavior.
Given the scenario:
1) User starts application for the first time - Application should go into an OnStart().
2) User hits the home button - Application should go into an OnSleep().
3) User returns back to the application - Application should go into an OnResume().
Currently when following 2) -> 3), OnResume does not seem to be called as expected in the lifecycle. Using Android's native OnResume(), it is observed that it is called appropriately when returning to an application.
I've seen a few different scenarios with the Xamarin.Forms OnResume() method:
1) OnResume() is not called at all. (Typically on a physical device)
2) OnResume() is called multiple times. (Seen on emulators mainly)
This seems to differ on device and emulator however.
Given the workflow on a physical Motorola 6 with API 22:
2) Hit Home
4) Return to Application
Although this is close to mimicking the lifecycle of Android, it still is calling OnResume() twice for some reason.
Besides what mentioned in this description it's not just calls to OnResume. When I run my app on Sony XPeria after pressing home button and coming back I see my first root screen, I don't return to the last screen I was on. It is like my app just started again. The events are actually appropriate to that scenario - I get OnStart instead of OnResume. This makes my Forms app not usable at all.
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Xamarin Forms Team