Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Description of Problem:
I have found that OnConfiguration is not called unless ConfigChanges.ScreenSize and ConfigChanges.Orientation are used together.
I guess this could also be a problem relating to the auto-generation of the AndroidManifest.xml?
Steps to reproduce the problem:
Use the following code:
[Activity (Label = "RotationTest1", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class Activity1 : Activity
static int count, orientation = 0;
protected override void OnCreate (Bundle bundle)
// Set our view from the "main" layout resource
Console.WriteLine( "OnCreate " + ++count);
public override void OnConfigurationChanged (Android.Content.Res.Configuration newConfig)
Console.WriteLine( "ConfigChanged " + ++orientation );
2. Remeove either ConfigChanges.ScreenSize or ConfigChanges.Orientation and run
OnCreate gets called unless both flags are present
OnConfigurationChanged when either flags are present
How often does this happen?
Device = Nexus 7
IDE = MonoDevelop v3.0.5
Target API = 16 (Jelly Beann)
This appears to be By Design:
> "orientation" The screen orientation has changed — the user has
> rotated the device.
> > Note: If your application targets API level 13 or
> > higher (as declared by the minSdkVersion and
> > targetSdkVersion attributes), then you should also
> > declare the "screenSize" configuration, because it
> > also changes when a device switches between portrait
> > and landscape orientations.
I believe that the "should" in the above note should be "must", given:
> In API level 13 or above, the screen size changes when the orientation
> changes, so this still causes the activity to be destroyed and started
> when orientation changes.
Note that that's a Android/Java question noting that when targeting API 13 or later (e.g. API 16), both both orientation and screensize must be provided or the Activity to be recreated.