Bug 43224 (A-B-C-A, navigation) - On Android when navigate from A to B then to C then back to A, the view A is not rendered correctly
Summary: On Android when navigate from A to B then to C then back to A, the view A is ...
Status: CONFIRMED
Alias: A-B-C-A, navigation
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-08-10 11:22 UTC by Adam Wu
Modified: 2016-10-02 04:24 UTC (History)
3 users (show)

Tags: navigation ac
Is this bug a regression?: No
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 for Bug 43224 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 Adam Wu 2016-08-10 11:22:07 UTC
How to replicate:

1. Create a PCL project, add 3 pages: Page1, Page2 and Page3.
2. In each page's constructor set page title to "Page 1", "page 2", and "Page 3"
3. In App.xaml.cs constructor add code
    MainPage = new NavigationPage(new Page1());

4. On each page, put one button on it
5. On page 1 button click event handler:
    await Navigation.PushAsync(new Page2());

6. On page 2 button click event handler:
    await Navigation.PushAsync(new Page3());

7. Then in page 3 the button click event handler I use below the code nav back to page 1 directly by escaping page 2.
    Navigation.RemovePage(Navigation.NavigationStack.ElementAt(1));
    await Navigation.PopAsync();

The code works perfectly on iOS but not on Android. On Android it seems nav back to page 1 but page 1 view is not rendered, the title "Page 1" is showing but the button is gone so the view is basically blank. I tested on Nexus 4 API19 and API 22 and the outcome is same.
Comment 1 Paul DiPietro [MSFT] 2016-08-10 16:15:11 UTC
I'm not able to reproduce this on an API 19 emulator. A reproduction project here would be helpful even if the replication steps are somewhat clear.
Comment 2 Adam Wu 2016-08-11 09:52:00 UTC
Hi Paul,

I can replicate the issue on API 19, 22 and 23 by using the Nexus 4 emulator. Please clone the demo project here: https://bitbucket.org/wjgroup/bugzilla
Comment 3 Adam Wu 2016-08-11 10:53:36 UTC
The project has 4 pages, at the last page there are 2 buttons, one button jump back to page 3 bypassing page 3, which won't work because page 2 will not render properly.
Comment 4 Paul DiPietro [MSFT] 2016-08-11 16:32:31 UTC
This appears to be an AppCompat issue and works when using FormsApplicationActivity.
Comment 5 Adam Wu 2016-08-12 00:59:37 UTC
Any more details or link to show a working example? Do you mean the MainActivity should reference from FormsApplicationActivity instead of the default FormsAppCompatActivity?
Comment 6 Adam Wu 2016-08-12 01:00:44 UTC
Sorry not reference from, I mean inherit
Comment 7 Paul DiPietro [MSFT] 2016-08-12 16:02:26 UTC
Yes, I mean that when the MainActivity inherits from FormsApplicationActivity instead of FormsAppCompatActivity, the issue doesn't occur. They are defined and function differently so this isn't particularly surprising, but it helps to know that one is displaying the issue and not the other.
Comment 8 adrianknight89 2016-10-02 04:24:49 UTC
This issue does not exist for me in XF 2.3.3.152-pre2. Please re-test in this version.