Hi All,

Anyone one can help me...I don't know how to use both landscape and portrait
mode ...When I design and modify the landscape and portrait means ,its
automatically  design was also changed in other mode ..So I plan to use two
different screens name and call it in onConfigurationChanged method.But I
don't know how to call it in oncreate method.if I call  means its showing
some error..
Anyone can say whether  ,a proper way of using orientation in mono for
android..Here I post my code also.

        [Activity (Label = "Setting",Theme =
"@android:style/Theme.Black.NoTitleBar.Fullscreen",ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation|Android.Content.PM.ConfigChanges.KeyboardHidden)]
//,ScreenOrientation = ScreenOrientation.Sensor         
        public class Setting : Activity
        {
                protected override void OnCreate (Bundle bundle)
                {
                        base.OnCreate (bundle);

                        //SetContentView(Resource.Layout.settingscreen);
                        //OnConfigurationChanged();
                        //SetContentView(OnConfigurationChanged);

                        //OnConfigurationChanged();

                                 
onConfigurationChanged(getResources().getConfiguration());
                }

                public override void OnConfigurationChanged
(Android.Content.Res.Configuration newConfig)
                {
                        base.OnConfigurationChanged (newConfig);
                        
                        
                        
if(newConfig.Orientation==Android.Content.Res.Orientation.Landscape)
                        {
                                
SetContentView(Resource.Layout.settingscreen_ls);

                                Button 
logout_btn=FindViewById<Button>(Resource.Id.logout_btn);
                                logout_btn.Click+= delegate {
                                        StartActivity(typeof(LoginScreen));
                                };
                                
                        }
                        else 
if(newConfig.Orientation==Android.Content.Res.Orientation.Portrait){
                                SetContentView(Resource.Layout.settingscreen);

                                Button 
logout_btn=FindViewById<Button>(Resource.Id.logout_btn);
                                logout_btn.Click+= delegate {
                                        StartActivity(typeof(LoginScreen));
                                };
                        }
                        
                }

        }
}


Give me a exact solution for using  orientation in monoandroid!

Thanks & Regards

Pushtest82



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/How-to-use-Orientation-onConfigurationChanged-method-in-monoandroid-tp5712944.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to