我想调用不同的{{1l当方向从水平变为垂直时意味着浴室布局不同URL
我该怎么办?
URL
答案 0 :(得分:0)
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE))
.getDefaultDisplay();
int orientation = display.getRotation();
if (orientation == Surface.ROTATION_90
|| orientation == Surface.ROTATION_270) {
URL = "[your landscape url]";
} else {
URL = "[your portrait url]";
}