关于android中获取横竖瓶状态

        安卓3.0开始横竖屏变化时不会触发onConfigurationChanged事件。
因为Activity总是需要重新创建。

判断横竖屏的方法:
在ACTIVITY的onCreate()方法里使用以下判断
if (getResources().getConfiguration().orientation
    == Configuration.ORIENTATION_LANDSCAPE) {
    // If the screen is now in landscape mode
    // 横屏显示中
}

else if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){  
            //竖屏 ,标准模式 320x480

}

 

3.0之前的版本是这样获取横竖屏状态的:

http://blog.csdn.net/tsk/article/details/6633905

 

 

你可能感兴趣的:(android)