if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { // 如果是横向的话 TODO } else { // 如果是竖向的话 TODO }