requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题栏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//设置全屏
2.设置横屏
两种方式:
1.重写onResume()方法
protected void onResume() {
if(getRequestedOrientation()!=ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)//设置横屏
}
//SCREEN_ORIENTATION_PORTRAIT此参数为设置为竖屏
super.onResume();
}
2.修改配置文件AndroidManifest.xml
android:launchMode="singleTask" android:screenOrientation="portrait">
原文:http://www.cnblogs.com/zyppac/p/3597156.html