Hi,
I don't want my activity be restarted, when user changes the screen
orientation.
I have tried setting ActivityAttribute.ConfigurationChanges, and override
it. But when the screen is reoriented, OnCreate method is called, and
onConfigurationChanged is never called.
[Activity(ConfigurationChanges =
Android.Content.PM.ConfigChanges.Orientation)]
public class BaseActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
//.......
}
public override void
OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged(newConfig);
if (newConfig.Orientation ==
Android.Content.Res.Orientation.Landscape)
{ Toast.MakeText(this, "landscape", ToastLength.Long).Show(); }
else
{ Toast.MakeText(this, "portrait", ToastLength.Long).Show(); }
}
}
}
And i also tried setting ActivityAttribute.ConfigurationChanges on Manifest,
but still not working.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<application android:icon="@drawable/grownotesmall">
<activity android:name="BaseActivity"
android:configChanges="orientation|keyboard|keyboardHidden"/>
</application>
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7"/>
</manifest>
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/OnConfiguration-is-not-being-called-tp5566767p5566767.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid