Configuration 类描述了设备的各种影响应用获取何种资源的系统信息,比如语言,横竖屏,输入方法,屏幕大小。
通过Resources类获取该类。
Configuration config = getResources().getConfiguration();
判断横竖屏
if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){
//TODO
}else if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
//TODO
}