// 判斷Android目前的螢幕是橫屏還是豎屏。橫豎屏判斷
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
//豎屏
} else {
//橫屏
}
this指針是目前Activity或者Context。
// 判斷Android目前的螢幕是橫屏還是豎屏。橫豎屏判斷
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
//豎屏
} else {
//橫屏
}
this指針是目前Activity或者Context。