Bug 57430 - LifeCycle fail after OnSleep, OnStart loads instead OnResume
Summary: LifeCycle fail after OnSleep, OnStart loads instead OnResume
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 6.0.1 (C6SR1)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-06-13 14:13 UTC by ffigueroa
Modified: 2017-08-21 21:13 UTC (History)
3 users (show)

Tags: bb
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED NORESPONSE

Description ffigueroa 2017-06-13 14:13:09 UTC
When the application sleep by changing to another application or loading the phone gallery, it calls OnStart instead OnResume, this issue was detected testing in Android 6.0.1 (Galaxy S7 Edge). I tried in some other phones but only 1 presented this issue.
Comment 1 ffigueroa 2017-06-13 14:33:37 UTC
The MainActivity has "ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation" as shown below:

[Activity(Label = "Climbapp.Droid", Icon = "@drawable/icono", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
Comment 2 Jon Douglas [MSFT] 2017-06-23 15:36:54 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.
Comment 3 espilioto 2017-07-26 12:31:01 UTC
Not sure if this belongs here since this is for Xamarin.Android, but here goes.

I just encountered this on Xamarin.Forms 2.3.5.256-pre6 .

I tested this by creating a new Xamarin.Forms project, adding debug messages in every method, plus an alert in OnResume().

OnResume() works normally on an Android 7.0 phone, the 6.0.1 Visual Studio emulator and on the iOS 10.3 emulator, but doesn't on my Android 5.0.1 device.
OnStart() gets called instead.

If I'm not mistaken, stable 2.3.4.247 works correctly only on iOS, calling OnStart() every time I tested it on any Android related device, real or not.
Comment 4 Jon Douglas [MSFT] 2017-08-21 21:12:42 UTC
(In reply to espilioto from comment #3)
> Not sure if this belongs here since this is for Xamarin.Android, but here
> goes.
> 
> I just encountered this on Xamarin.Forms 2.3.5.256-pre6 .
> 
> I tested this by creating a new Xamarin.Forms project, adding debug messages
> in every method, plus an alert in OnResume().
> 
> OnResume() works normally on an Android 7.0 phone, the 6.0.1 Visual Studio
> emulator and on the iOS 10.3 emulator, but doesn't on my Android 5.0.1
> device.
> OnStart() gets called instead.
> 
> If I'm not mistaken, stable 2.3.4.247 works correctly only on iOS, calling
> OnStart() every time I tested it on any Android related device, real or not.

This most likely belongs in a Xamarin.Forms bug. If they decide it's an Android issue, they can change the product category in Bugzilla. The lifecycle methods mapped to the Xamarin.Forms ones do not 1:1 match with the Android ones IIRC.
Comment 5 Jon Douglas [MSFT] 2017-08-21 21:13:21 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!