Bug 37324 - Using PushModalAsync via native page causes page to open behind current activity
Summary: Using PushModalAsync via native page causes page to open behind current activity
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-12-29 16:54 UTC by Cody Beyer (MSFT)
Modified: 2017-09-07 12:45 UTC (History)
4 users (show)

Tags: ac, android, navigation
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:

Description Cody Beyer (MSFT) 2015-12-29 16:54:46 UTC
### Description

The following sample demonstrates an issue where opening a modal page from a native activity causes the modal page to open behind the current page

### Sample


### Steps to Reproduce


### Expected Results

Page should open on top of navigation stack

### Actual Results

Page opens behind current page

### Versions

=== Xamarin Studio ===

Version 5.10.1 (build 6)
Installation UUID: 2527b5de-f131-4e28-b99e-42db8bb5fcff
	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: (Business Edition)
Hash: 7322991
Branch: master
Build date: 2015-12-08 16:20:29-0500

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.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: (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 Codys-Mac.router 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 Vishnu 2016-01-05 09:50:46 UTC
Is any workaround or resolution for this issue is found?
Comment 2 Florin Chelaru 2016-09-28 08:47:11 UTC
I seem to have the same problem. Any solutions?
Comment 3 Stephane Delcroix 2016-12-20 20:10:59 UTC
I'm able to reproduce this on a recent Form version, but you should try and check if it happens also on AppCompat
Comment 4 David Ortinau [MSFT] 2017-09-07 12:45:32 UTC
The Forms app Context is associated with the initial Activity and not the second Activity. The modal isn't behind the second activity, it's part of the Activity where Forms was initialized.

By launching a second native Activity, there are now 2 disconnected navigation stacks: the Forms stack, and the native.

Some possible solutions would be to use Fragments and create PageRenderers, maintaining the same Context with Forms.