Bug 58867 - OnAppearing and OnDisappearing out of sequence with PushModalAsync during backgrounding/foregrounding app
Summary: OnAppearing and OnDisappearing out of sequence with PushModalAsync during bac...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-17 22:52 UTC by TijoT
Modified: 2017-11-18 17:09 UTC (History)
5 users (show)

Tags: appearing, backgrounding, ac
Is this bug a regression?: ---
Last known good build:


Attachments
Xamarin Forms Solution Android Platform (58.88 KB, application/x-zip-compressed)
2017-08-17 22:52 UTC, TijoT
Details


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 for Bug 58867 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description TijoT 2017-08-17 22:52:51 UTC
Created attachment 24285 [details]
Xamarin Forms Solution Android Platform

I have two pages, Main page and Page1. Main page is the root page with navigation. Button tap in Main Page triggers PushModalAsync of Page1.

Steps:
Launch Application 
Click Button in Main Page
Page1 Appears
Tap home button to background the app
Launch App again to make it foreground
Page1 Appears

Actual Sequence of OnAppearing/OnDisappearing

OnAppearing MainPage
OnDisappearing MainPage
OnAppearing Page1
OnAppearing MainPage

Instead of

OnAppearing MainPage
OnDisappearing MainPage
OnAppearing Page1
OnDisappearing Page1
OnAppearing Page1

Xamarin Forms : 2.3.4.247
Android OS: 6.0.1
Comment 1 Paul DiPietro [MSFT] 2017-08-17 23:38:49 UTC
Also tested against the 2.4.0pre1 build.
Comment 2 TijoT 2017-08-29 20:22:14 UTC
Hi Paul,

Can you please let me know which release this issue will be fixed?
Comment 3 adrianknight89 2017-11-18 17:09:40 UTC
This issue (or a similar one) was discussed a long time ago. See if you can use these platform specifics to disable these events on pause/resume.

https://developer.xamarin.com/guides/xamarin-forms/platform-features/platform-specifics/consuming/android/#disable_lifecycle_events

Maybe this wasn't fixed to avoid introducing breaking changes. You'd have to send messages to your individual pages on App Pause/Resume events instead. Dirty hack, but it does the work.