android 判断横竖屏的方法(转)

public boolean isScreenChange() {

Configuration mConfiguration = this.getResources().getConfiguration(); //获取设置的配置信息
int ori = mConfiguration.orientation ; //获取屏幕方向

if(ori == mConfiguration.ORIENTATION_LANDSCAPE){

//横屏
return true;
}else if(ori == mConfiguration.ORIENTATION_PORTRAIT){

//竖屏
return false;
}
return false;
}

 

 
自:http://blog.csdn.net/zhenglingkun/article/details/8306591

posted on 2015-03-13 14:45  益达的博客  阅读(609)  评论(0编辑  收藏  举报

导航