Bug 22269 - MasterDetailPage Problems on Android
Summary: MasterDetailPage Problems on Android
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-08-21 15:25 UTC by Anonymous
Modified: 2015-05-22 14:55 UTC (History)
6 users (show)

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 Anonymous 2014-08-21 15:25:27 UTC
I've found two problems with MasterDetailPage on Android. This is my first time posting, so if the bugs need to be split up into individual reports, just let me know.

1) When using SetPage to set a MasterDetailPage for the initial time on Android, the Action Bar will incorrectly show a back indicator.

2) Attempting to use SetPage again with another MasterDetailPage throws a Java.Lang.IllegalArgumentException : DrawerLayout must be measured with MeasureSpec.EXACTLY.
Comment 1 Arpit Jha 2014-08-25 08:05:48 UTC
I have checked this issue and unable to reproduce it.

I have tried following steps to reproduce it .

1.Create a PCL Application.
2.Add NamedColor(.cs) ,NamedColorPage(.cs) and HomePage.cs
3.Inherit MasterDetailPage in HomePage.cs 
4.Call HomePage.cs in App.cs
5.Call GetMainPage() in MainActivity.cs( Xamarin.Android ).
6.Run the application.

I observed that SetPage again with another MasterDetailPage does not throw any exception.

Please clarify your first point .

Let me know if i missed anything to reproduce this issue.

ScreenCast: http://screencast.com/t/0mxUt8yE

Environment Info: 
Comment 2 Chase Florell 2014-08-25 10:43:48 UTC
For issue (1), it'll show a back arrow instead of a hamburger icon if you don't explicitly set the icon. Just make sure your "Master" page has an "Icon" set.
Comment 3 Anonymous 2014-08-25 12:21:15 UTC
Thanks Chase, I guess I was assuming it would just use the application icon (without the back arrow) if I failed to set one explicitly.
Comment 4 Anonymous 2014-09-05 13:25:26 UTC
Rather than attempting to create new MasterDetail pages each time I clicked on something, I opted to just change the detail side of the page. Closing this issue.
Comment 5 Anonymous 2014-09-12 12:34:03 UTC
I was finally able to track down the second issue mentioned above. Steps to reproduce:

1. SetPage() a NavigationPage with a ContentPage onto the screen.
2. SetHasNavigationBar to true on that ContentPage.
3. Call SetPage() with a MasterDetailPage while the previous page is still onscreen.
4. Java.Lang.IllegalArgumentException : DrawerLayout must be measured with

If the first page does not show a NavigationBar everything works fine.
I have a simple test project that reproduces the issue if need be.
Comment 6 Michael 2015-05-22 14:48:15 UTC
I was not able to recreate the issue mentioned in comment #5 by following the steps to reproduce. I tested this using Xamarin Forms 1.4.2.

If you are still experiencing this problem, please provide the simple test project that reproduces the issue.
Comment 7 Anonymous 2015-05-22 14:55:28 UTC
I can confirm this is no longer an issue in 1.4.2. Marking as RESOLVED.