Bug 30361 - X.Forms Android HomeAsUp (Back) button/arrow disappears when navigating Native-to-Forms
Summary: X.Forms Android HomeAsUp (Back) button/arrow disappears when navigating Nativ...
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.5
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Chris King
Depends on:
Reported: 2015-05-22 12:17 UTC by Chris Riesgo
Modified: 2017-08-21 13:10 UTC (History)
6 users (show)

Tags: ac android native2forms renderers
Is this bug a regression?: ---
Last known good build:

Repro Case (29.25 KB, application/zip)
2015-05-22 12:17 UTC, Chris Riesgo
updated repro project (42.70 KB, application/x-zip-compressed)
2017-06-15 16:50 UTC, Jimmy [MSFT]

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 Chris Riesgo 2015-05-22 12:17:12 UTC
Created attachment 11300 [details]
Repro Case

I have a Xamarin.Forms app where I navigate from a native android activity (page one) to a forms activity, which displays a forms page (page two), which has a button that takes you to a third forms page (page three). 

If you navigate to page two, the back arrow appears (as if indicating you can go back). You can then tap the button and navigation to the third forms page. Once on the third page, when you tap the soft back button (on the bottom), you are returned to Page Two, but the Back button (Home As Up) no longer appears in the top navigation bar. It's only there when navigating forward from Page One. 

Is this a bug or is there a workaround?
Comment 1 Chris King 2015-05-22 16:28:34 UTC
We'd be happy to help you resolve this issue. Could you please try and reproduce the issue without modifying the platform specific projects? That would eliminate a number of possibilities and likely expedite a resolution. If you must modify the platform specific libraries please let us know why so we might extend the Forms platform to accommodate your scenario. 

Warm regards,
Xamarin Forms Team
Comment 2 Chris Riesgo 2015-05-22 16:44:26 UTC
The structure of the application is:

1. Several Native Android Activities/Fragments
2. Tapping a button on one of the native views navigates you to a Forms Page (Using the Native-To-Forms Samples as a guide on how to do that)
3. Forms Page appears with button
4. Tapping the button takes you to another Forms page.

Because of that structure, the Repro example that I submitted _must_ have modifications to the platforms specific projects in order to construct a simple Native - To - Forms experience. It's the simplest example app that I could build to repro the issue. The bug appears to be in that Android implementation. I've set values to ask that the Back Button be shown. It shows when navigating forward, but doesn't consistently show when navigating backwards (see original post for details).

Does that clarify, Chris King?
Comment 3 Jimmy [MSFT] 2017-06-15 16:50:28 UTC
Created attachment 22928 [details]
updated repro project

This issue still occurs with recent versions of Xamarin.Forms. I'm attaching an updated repro project.

The issue occurs with both FormsApplicationActivity and FormsAppCompatActivity. The behavior is worse with FormsAppCompatActivity because in this case the back arrow does _not_ appear when the activity is initially navigated to unlike with FormsApplicationActivity.

### Steps to Reproduce 
1. Run the attached project
2. Press "Go to Forms Activity" or "Go to FormsAppCompat Activity"
3. Press "Open Page 3"
4. Go back

### Expected Results
The navbar "up" arrow should be visible to indicate that you can return to the native activity

### Actual Results
The "up" arrow does not appear. 

### Version Tests   BAD
2.3.5-pre3  BAD
Comment 4 Chris Riesgo 2017-07-11 16:01:00 UTC
I'm excited to see this move to IN PROGRESS. I remember running into this bug the first time.
Comment 5 Chris King 2017-07-12 16:59:25 UTC
Chris, can you review Jimmy's reproduction to ensure it accurately captures the issue you are seeing? That is to say, if we make that reproduction work will it solve you're issue?
Comment 6 Chris King 2017-07-12 17:52:20 UTC
We're not planning on supporting this scenario in core; We're going to punt on making navigation work across native/forms navigation stacks. 

That said, there may be a way we can achieve the behavior you want by having your app push a dummy page and upon landing on that page pop the forms activity. 

Would you like us to try and cook a sample demonstrating this approach? Or have you already worked aroud or just reporting the issue for our information?
Comment 7 Chris Riesgo 2017-07-12 21:45:11 UTC
I worked around the issue already. My original post was mostly informational in case the priority ever escalated. If you think it would be useful, I can review Jimmy's repro, but if this is going to be shelved, might make more sense for someone to do that if/when this idea is revisited.
Comment 8 Paul DiPietro [MSFT] 2017-08-21 13:10:55 UTC
Marking this as resolved, based on the prior comments.