android反正屏显示

android横竖屏显示横竖屏显示privatevoid changedScreen(){int request this.getRequestedOrientation()

android横竖屏显示
横竖屏显示

private
void changedScreen(){


int request = this.getRequestedOrientation();


if(request == -1){


Toast.makeText(TaskRunActivity.this, "None 1", Toast.LENGTH_SHORT).show();


}else{


if(getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){


this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);


}else
if(getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT){


this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);


}


}


}