How to use Orientation in mono for android? Here I post my code ,
[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(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)); }; } } } } onConfigurationChanged(getResources().getConfiguration()); calling this method in onCreate ,its showing error.what method we have to call it? Bcoz I am new to monoandroid,Comparing to Android(native) is easy to use orientation...Y?,its not easy way to use orientation in monoandroid?CAN ANYONE HELP ME!!!..... -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/OnConfiguration-is-not-being-called-tp5566767p5712943.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