//隐藏标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐藏状态栏
//定义全屏参数
int
flag=WindowManager.LayoutParams.FLAG_FULLSCREEN;
//获得当前窗体对象
Window window=MainActivity.
this
.getWindow();
//设置当前窗体为全屏显示
window.setFlags(flag, flag);
以上代码需要添加在setcontent之前。