如何为Android中的“ nosensor”屏幕方向模式确定屏幕方向?什么时候是纵向还是横向?
尝试一下
int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { // In landscape } else { // In portrait }