void android.app.Activity.setRequestedOrientation(int requestedOrientation)
 
官方API解释:
Otherwise, this will be used the next time the activity is visible.
 
中文大意:
否则,这将在activity 下一次可见时使用。
 

//设横屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

相关文章: