Activity is restarted when the screen orientation changed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Activity is restarted when the screen orientation changed

venkatesh
Hi,

I don't want my activity be restarted, when user changes the screen orientation for API Level 15 and above.
I have tried setting ActivityAttribute.ConfigurationChanges in the main activity . But when the screen is oriented, Activity is restarted .

   [Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation)]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {

            base.OnCreate(bundle);
           //.......
        }


Kindly suggest me on this.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Activity is restarted when the screen orientation changed

Massimiliano Fabbri
you need to fix the orientation in the activity label.
Just do a search on the xamarin forum
Il 19/09/13 10:03, venkatesh ha scritto:

> Hi,
>
> I don't want my activity be restarted, when user changes the screen
> orientation for *API Level 15* and above.
> I have tried setting ActivityAttribute.ConfigurationChanges in the main
> activity . But when the screen is oriented, Activity is restarted .
>
>     [Activity(ConfigurationChanges =
> Android.Content.PM.ConfigChanges.Orientation)]
>      public class MainActivity : Activity
>      {
>          protected override void OnCreate(Bundle bundle)
>          {
>
>              base.OnCreate(bundle);
>             //.......
>          }
>
>
> Kindly suggest me on this.
>
> Thanks.
>
>
>
> --
> View this message in context: http://mono-for-android.1047100.n5.nabble.com/Activity-is-restarted-when-the-screen-orientation-changed-tp5713524.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> [hidden email]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|

Re: Activity is restarted when the screen orientation changed

venkatesh
Hi Fabbr,

Thanks for your reply.

Implementing ConfigurationChanges config  in  Activityattribute  solved the issue for Android API Level 14 and above.

[Activity ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize ]


Thanks