Bug 25914 - Crashes when title bars are suppressed in an Android application.
Summary: Crashes when title bars are suppressed in an Android application.
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: 2015-01-11 18:45 UTC by Brian Berry
Modified: 2015-05-19 16:58 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 Brian Berry 2015-01-11 18:45:35 UTC
Found: When suppressing the application title bar, the invocation of
FormsApplicationActivity.LoadApplcation() results in a null reference
exception in the following context:

System.Diagnostics.Debugger.Mono_UnhandledException_internal () in 
System.Diagnostics.Debugger.Mono_UnhandledException (Parameters=) in 
object.61900b22-b05e-4b5b-b610-34dd28450f70 (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.UpdateActionBarHomeAsUp (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.HideActionBar (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.UpdateActionBar (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.SetPage (Parameters=) in 
Xamarin.Forms.Platform.Android.FormsApplicationActivity.InternalSetPage (Parameters=) in 
Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetMainPage (Parameters=) in 
Xamarin.Forms.Platform.Android.FormsApplicationActivity.LoadApplication (Parameters=) in 
. . .

Steps to reproduce:
  * Create a Xamarin.Android+Forms application that suppresses
    the title bar by either of two methods:
     - Addition of 'Theme = "@android:style/Theme.NoTitleBar"' Activity
       attribute tagging.
     - Call RequestWindowFeature(WindowFeatures.NoTitle) prior to base.OnCreate(bundle).

Expected: No null reference excpetions.

   * This is actually, the tip NuGet prerelease package
     at the time of this bug submission.
   * Smells like the X.F.P.Android code is simply assuming the presence of the
     title bar I have opted out of---probably just needs to be guarded.

Comment 1 Jatin 2015-01-12 03:07:51 UTC
I am successfully able to reproduce this issue at my end using the latest build.

Below are the detailed steps to reproduce this issue:
1. Open the XS and Create a Xamarin.Android Forms application.
2. Add the Package: Xamarin.Forms with version
3. In MainActivity.cs file add the code: Theme = "@android:style/Theme.NoTitleBar"
4. Build and Debug the project
5. Observe the issue stated in Comment #0

Below is the screencast for the same:

Supplement information:
Application output: https://gist.github.com/Mohit-Kheterpal/0eae4f1475c6245ec137
Android Tools Log: https://gist.github.com/Mohit-Kheterpal/cde3ae9490819bd41e28
IDE Logs: https://gist.github.com/Mohit-Kheterpal/3a00ecce388d35e2b9d4

Build information:

=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 561dfed
Build date: 2015-01-06 17:56:14-0500

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/360logicaxamarinmacmini/Desktop/android-sdk-macosx_AndÃsdk
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		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)

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.8.4
Darwin 360LogicasMacmini.local 12.4.0 Darwin Kernel Version 12.4.0
    Sun Mar 10 18:01:10 PDT 2013
    root:xnu-2050.24.6~1/RELEASE_X86_64 x86_64

Hence, marking this issue as confirmed.
Comment 2 Jason Smith [MSFT] 2015-05-19 15:25:27 UTC
Forms does not currently support not having an action bar in the theme.
Comment 3 Brian Berry 2015-05-19 16:40:22 UTC
Respectfully, that answer basically just restates the bug.   How is that a resolution?
Comment 4 Shawn Poindexter 2015-05-19 16:58:25 UTC
I agree with Brian.