Seems like I found a way, even though on Android 3.2 the behavior is not
exactly the same.
I changed the splash activity attributes
*ConfigurationChanges *= Android.Content.PM.ConfigChanges.*
Orientation* | Android.Content.PM.ConfigChanges.KeyboardHidden |
(Android.Content.PM.ConfigChanges)*0x0400*,
*ScreenOrientation *= Android.Content.PM.ScreenOrientation.*Behind*
The 0x400 defines as screenSize (
http://developer.android.com/reference/android/R.attr.html#configChanges).
I had to force the value because it is not present (still)
in Android.Content.PM.ConfigChanges enum.
and I overridden OnConfigurationChanged( Android.Content.Res.Configuration )
public override void *OnConfigurationChanged*(
Android.Content.Res.Configuration newConfig )
{
base.OnConfigurationChanged( newConfig );
*RequestedOrientation = *Android.Content.PM.ScreenOrientation.*
Behind;*
}
On android 2.3.3 and 2.3.4 nothing changed. Splash starts with current
orientation and does not change if I flip the device.
On android 3.2 splash starts with current orientation and changes when I
flip the device, though, the activity is not restarted. So, still fits the
requirement.
Cheers
On 29 May 2012 14:47, Goncalo Oliveira <[email protected]> wrote:
> I don't really know if this is a monodroid issue or just android's
> behavior.
>
> I have a splash activity and I don't want it to rotate automatically if
> you flip the screen, but I do want it to start with the current orientation.
> To do this, I set the ScreenOrientation to ScreenOrientation.Behind.
>
> On devices with android 2.3.3 and 2.3.4 this works perfectly. The activity
> starts with the current orientation and if you flip the device, the
> activity doesn't restart. Only when you start the next activity it rotates.
> This is the wanted behavior, so, success.
>
> Now, I have another device on stack. A Samsung Galaxy Tab 7 with android
> 3.2. And on this device, the splash activity always flips to landscape,
> which results in a awkward behavior. Device is on portrait position, splash
> goes landscape and landing activity flips back to normal. Seems like
> something changed.
>
> I tried using other settings, like ScreenOrientation.User and
> ScreenOrientation.Behind, but both rotate if I flip the device during the
> splash. I guess I could go with fixing ScreenOrientation.Portrait, but that
> is not the wanted behavior.
>
> I'm pretty sure this is an android issue, but I can't find much
> information on this.
> Any ideas?
>
> Cheers
>
> --
> Gonçalo Oliveira
>
--
Gonçalo Oliveira
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid