[android-developers] Re: activity launches with wrong layout orientation

2011-10-12 Thread 刘家豪
You might try to use the follow code from the Java class: switch (this.getResources().getConfiguration().orientation) { case Configuration.ORIENTATION_PORTRAIT: // Do something here break; case Configuration.ORIENTATION_LANDSCAPE: // Do something here break; case

[android-developers] Re: activity launches with wrong layout orientation

2011-10-08 Thread Goodwin
I never find this issue. maybe you could supply more code. On Oct 7, 8:50 pm, Simon simon.wilkin...@gmail.com wrote: Hi, I have an activity that I have two layouts defined for: one for landscape and one for portrait.  So in my layout folder I have activity.xml and activity_landscape.xml.  

[android-developers] Re: activity launches with wrong layout orientation

2011-10-08 Thread decode
you should have instead placed the layout files in layout and layout- land. I assume that you must be updating the layout in just onCreate and onConfigurationChanged method. But, you should also check for the configuration and update it in onResume. Its better to use the folders if there isnt