This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.

Bug 52318

Summary: OnAppearing/Disappearing triggers for all pages in navigationstack backgrounding/foregrounding app
Product: Forms Reporter: Jens-Christian <jens.christian>
Component: AndroidAssignee: Bugzilla <bugzilla>
Severity: normal CC: adrianknight89, bjorn.bentmar, david, davrdavr, ionixjunior, jason.smith, kaushal.panjwani, kent.boogaart, rui.marinho, samantha.houts, thomas, tobbe.l.malm
Priority: ---    
Version: 2.3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Test case to trigger error

Description Jens-Christian 2017-02-06 14:18:49 UTC
This is almost the same as, except that I'm using MasterDetailPage, not NavigationPage as my MainPage.

When using MasterDetailPage, the error is still present.

I'm testing using Xamarin.Forms
Comment 1 Björn Bentmar 2017-02-06 14:36:55 UTC
Can you describe the case a bit more?
Comment 2 Jens-Christian 2017-02-07 07:00:40 UTC
Created attachment 19745 [details]
Test case to trigger error

I have modified the example from, to use MasterDetailPage instead, to trigger this error.

The error is that when you have several pages in the navigation stack, and navigation out of the application (push home button, open web page with Device.OpenUri, take a photo, etc), all pages in the navigation stack receives OnAppearing, and will not receive OnAppearing when the pages are popped from the navigation stack.
Comment 3 Björn Bentmar 2017-02-07 10:05:51 UTC
sigh.. I just confirmed it, the same behavour still appears from the bug when the NavigationPage is the detailpage of a MasterDetailPage.
Comment 4 Björn Bentmar 2017-02-07 10:24:35 UTC
However, this can be worked around.

in you App.cs add:


Now if you want to trigger appearing/disappearing on resume/pause, use the native resume/pause and implement a message for your own appearing/disappearing logic when app resumes or pauses
Comment 5 Jens-Christian 2017-02-07 11:18:48 UTC
Thank you for the workaround, I will look into it if the error isn't fixed when Xamarin.Forms 2.3.4 goes stable.
Comment 6 adrianknight89 2017-02-09 04:54:01 UTC
Comment 7 Ione Souza Junior 2017-03-02 11:41:50 UTC
I found a similar problem, I looking for similar issues before create new ticket and found this.

Behaviour in iOS: 
1) Open app;
2) Navigate to second page
3) Put the app in background

After this, OnDisappearing event on page 2 is not called.

4) Put the app in foreground

After this, OnAppearing event on page 2 is not called.

Behaviour in Android

1) Open app;
2) Navigate to second page
3) Put the app in background

After this, OnDisappearing event on page 2 is called.

4) Put the app in foreground

After this, OnAppearing event on page 1 and 2 are called.

I attach sample project named NavPageProject for testing.

Informations about my environment:

=== Xamarin Studio Community ===

Version 6.2 (build 1821)
Installation UUID: a6a5f1a6-63ce-4c25-b5f7-1942c9a48cde
	Mono 4.8.0 (mono-4.8.0-branch/e4a3cf3) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000495

=== NuGet ===


=== Xamarin.Profiler ===

Version: 1.0.2
Location: /Applications/Xamarin Profiler

=== Xamarin.Android ===

Version: (Xamarin Studio Community)
Android SDK: /Users/ionixjunior/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: (Xamarin Studio Community)

=== Xamarin.iOS ===

Version: (Xamarin Studio Community)
Hash: 35d1ccd
Branch: cycle9
Build date: 2017-02-16 17:40:00-0500

=== Xamarin Inspector ===

Hash: cdc01b9
Branch: 1.1-release
Build date: Wed, 22 Feb 2017 23:24:11 GMT

=== Build Information ===

Release ID: 602001821
Git revision: d41b6e51f3fa46a1943f2e31a778d28a7c73d069
Build date: 2017-02-17 15:18:19-05
Xamarin addins: 1363a8d943bab7700c93a97474060b6734aa7f94
Build lane: monodevelop-lion-cycle9

=== Operating System ===

Mac OS X 10.12.0
Darwin ione.local 16.0.0 Darwin Kernel Version 16.0.0
    Mon Aug 29 17:56:20 PDT 2016
    root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64
Comment 8 Ione Souza Junior 2017-03-02 11:42:53 UTC
Created attachment 20083 [details]

Sample project.
Comment 9 thomas 2017-03-10 07:53:36 UTC
This especially a problem for all users of RxUI as it heavily relies on the WhenActivated pattern which uses the OnAppearing Hook
Comment 10 Diego 2017-03-10 18:02:43 UTC
Tested in Xamarin.Forms, this bug remains.
Using MasterDetail
Comment 11 Rui Marinho 2017-03-14 12:05:05 UTC
Should be fixed on 2.3.5-pre1
Comment 12 Diego 2017-03-30 12:46:47 UTC
@Rui, where could we get the version 2.3.5-pre1. So far the latest version in Nuget is