Bug 42713 - Unpredictable page lifecycle in TabbedPage using FormsAppCompatActivity
Summary: Unpredictable page lifecycle in TabbedPage using FormsAppCompatActivity
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-07-21 14:07 UTC by Rob Hedgpeth
Modified: 2016-07-21 21:31 UTC (History)
2 users (show)

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

SampleApp (70.45 KB, application/x-zip-compressed)
2016-07-21 14:07 UTC, Rob Hedgpeth

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:

Description Rob Hedgpeth 2016-07-21 14:07:26 UTC
Created attachment 16743 [details]

Scenario: (Android) Forms app with one TabbedPage that contains three content pages (Page1/Page2/Page3).

I've encountered an issue where on start up of the app the OnAppearing method is being called for both Page1 and Page2. Upon tapping on the second tab to navigate to Page2 the only OnAppearing method to be called is Page3 even though Page2 is the page being shown. This only happens when the main activity in the Android project inherits from FormsAppCompatActivity. I've attached a small sample app to demonstrate the issue.
Comment 1 Samantha Houts [MSFT] 2016-07-21 21:31:18 UTC
TabbedPage on AppCompat Android uses the Android ViewPager control, which preloads the tabs that are adjacent to the selected tab. This will fire the Appearing event for the preloaded tabs, even if they are not immediately visible. This is expected behavior.