Bug 37775 - Android - OnAppearing() not being called when returning from pushed page
Summary: Android - OnAppearing() not being called when returning from pushed page
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-01-18 15:56 UTC by Adam Hartley [MSFT]
Modified: 2016-08-12 08:06 UTC (History)
11 users (show)

Tags:
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 FIXED

Description Adam Hartley [MSFT] 2016-01-18 15:56:28 UTC
## Steps to reproduce

1. Download sample: https://www.dropbox.com/s/kg9quw19h7e5q84/OnAppearingDemo.zip?dl=0
2. Run the "OnAppearingDemo Tabbed Version" droid project on a device or simulator
3. Dismiss alert
4. Tap on "Next Page"
5. Tap on the back button

## Expected results

An alert stating that OnAppearing() has been called

## Actual results

OnAppearing() is not called, so no alert is shown

## Notes 

The iOS project displays the expected behaviour

=== Xamarin Studio ===

Version 5.10.1 (build 6)
Installation UUID: 11a26d86-0d21-407a-8da9-8c197ecc0ad1
Runtime:
	Mono 4.2.1 (explicit/6dd2d0d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010102

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.2 (9548)
Build 7C68

=== Xamarin.iOS ===

Version: 9.4.0.0 (Business Edition)
Hash: 7322991
Branch: master
Build date: 2015-12-08 16:20:29-0500

=== Xamarin.Android ===

Version: 6.0.0.34 (Business Edition)
Android SDK: /Users/Adam/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.4.0.109 (Business Edition)

=== Build Information ===

Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

=== Operating System ===

Mac OS X 10.11.2
Darwin Adams-Retina-MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 1 Lyndon Hughey 2016-01-21 21:01:10 UTC
I can confirm that this is happening.  The onAppearing event is not being called when returning to a master page from the detail page.  This is when happening when using a tabbedPage as a main page.
Comment 2 anderson.jacobd 2016-01-27 01:51:48 UTC
I would also like to add that if you push a Modal page async, then other pages async on top of that one, background, and then resume, only the modal page's OnAppearing is called on Android, not the page that is displayed to the User.
Comment 3 Francisco 2016-05-10 07:37:49 UTC
I confirm this bug, please anybody knows any workaround? When will the Xamarin team fix it?

Thanks.
Comment 4 vitor_sevenfold 2016-05-17 17:38:36 UTC
I have the same problem in my apps.
When will the Xamarin team fix it?
Thanks!
Comment 5 Björn Bentmar 2016-05-25 11:06:03 UTC
A workaround is to look at the onAppearing event for your TabbedPage, Check what children is the active tab (page) and call a method on it
Comment 6 Paul DiPietro [MSFT] 2016-06-09 16:46:18 UTC
I've tested the reproduction originally provided against the latest stable version of Forms (2.2.0.45) and it appears to show the alert as expected. If someone has a reproduction to share in which this isn't working (specifically a circumstance which is separate from the original issue mentioned), please feel free to reopen this or file a new bug.
Comment 7 Lyndon Hughey 2016-07-05 16:30:48 UTC
Paul, this issue is not fixed.  I've created solution using the Forms v2.3.0.49 illustrating that problem still exists.  The sample solution can be downloaded at https://dl.dropboxusercontent.com/u/78374852/Poppin.zip

I also created a post on the forums at https://forums.xamarin.com/discussion/69804/onappearing-still-not-firing-after-modalpop-in-droid-applications-sample-included#latest a couple of weeks back.  Additionally, I've responded to an older post at http://forums.xamarin.com/discussion/comment/207906/#Comment_207906
Comment 8 Keegan Bailey 2016-07-28 23:28:00 UTC
This has not been fixed. Workaround I have been using is message passing on android to call OnAppearing.
Comment 9 tim.ahrentlov 2016-08-12 08:06:33 UTC
This bug is not fixed as of 2.3.2-118-pre1