Ok... So my problem is to prevent from activity to reload after orientation is changed. Basically, what I did is this:
[Activity(Label = \"migs\", ConfigurationC
what happen when orientation change (consider you enable rotation in your phone) ?
Android restart activity onDestroy()
is called, followed by onCreate()
, you can distinguish between onDestroy()
call to kill activity or restart app throw old answer.
Prevent Activity restart
just set ConfigurationChanges to both Orientation
, ScreenSize
[Activity (Label = "CodeLayoutActivity", ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
why this may be not working ?
I dont think this will not working but set RetaintInstance
to true read more about RetainInstance
class myFragment: Fragment
{
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
this.RetainInstance = true;
// this to change screen orientation
Activity.RequestedOrientation = ScreenOrientation.Landscape;
}
.....
}
hope this help