Bug 24688 - [Android] Unable to open new ContentPage by setting the MainPage
Summary: [Android] Unable to open new ContentPage by setting the MainPage
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-11-20 05:44 UTC by Tim Brand
Modified: 2015-02-10 07:30 UTC (History)
5 users (show)

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

Additional test case (95.83 KB, application/zip)
2014-11-25 23:02 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 Tim Brand 2014-11-20 05:44:16 UTC
When setting the Application.Current.MainPage to a new ContentPage on Android it just shows an empty screen. The same behaviour is working fine on iOS.

Steps to reproduce:
1: Open a ContentPage with a button in the App.cs as MainPage;
2: When pressing the button, init a new ContentPage and set it to Application.Current.MainPage
From here you'll see a blank screen.

Application on GitHub to reproduce: https://github.com/App-Artment/xamarin-forms-tests
Comment 1 Udham Singh 2014-11-21 09:23:44 UTC
I have checked this issue and observed that on running the android app, it loads the first screen properly with a label 'Xamarin Forms Tests'  and a button 'Tap here to start' and when we click on button 'Tap here to start' it shows an empty screen (black screen), however for iOS this  is working fine and loads the next screen properly with a menu item.

Screencast : http://www.screencast.com/t/D3pH0EKS

Application Output : https://gist.github.com/Udham1/fbd0c60eaea55a24bc92

Environment Info :

Xamarin.Forms :

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: (Enterprise Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.Mac ===

Version: (Enterprise Edition)

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 840a925
Build date: 2014-11-16 21:03:22-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2014-11-25 23:02:37 UTC
Created attachment 8873 [details]
Additional test case

I'll attach a second simple test case here, just in case it might come in handy to have a project stored directly in Bugzilla.

This test case initially sets `Application.MainPage` to a `ContentPage` containing a "Main Page" label and a "Go to page 2" button. Tapping the button sets `Application.MainPage` to a new `ContentPage` that contains a "Second Page" label.

Regression status: new feature in 1.3.0

## Steps to reproduce 

1. Build and run the attached test case on an Android device or emulator.

2. Tap the "Go to page 2" button.

## Result

The screen switches to an empty display.

## Expected result

If you run the iOS or Windows Phone projects from the test case and tap the "Go to page 2" button, a new screen appears that shows the label "Second Page".

## Version information


Xamarin (10cfd178d55287f09c85f5a1e604dfe20889a40f)
Xamarin.Android (ba9bbbdd44cfdc4bf485e8885bd2ad24fba525f7)
Xamarin.iOS (840a925103a0bf4a856507f13d5eaee3c1579c2f)

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

NuGet Package Manager   2.8.50926.663
Comment 3 Jason Smith [MSFT] 2014-12-04 21:28:58 UTC
Fixed in next release
Comment 4 Udham Singh 2015-02-10 07:30:44 UTC
I have checked this issue with Xamarin.Forms Version and observed that now this is working fine. Hence I am closing this issue.

Please refer the screencast : http://www.screencast.com/t/KFzAV4lMIm4

Environment Info :

Xamarin.Forms :

Mac OS X 10.9.5
Xamarin Studio 5.7.1 (build 17)
Mono 3.12.0 ((detached/a813491)
GTK+ 2.24.23 (Raleigh theme)
Xcode 6.2 (6770)
Xamarin.iOS (Business Edition)
Xamarin.Android (Business Edition)