//come from google
If you only want to remove the title bar, add this line to onCreate() method of your activity:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
If you want to set your activity to use the whole display screen, which means also remove the status bar, you need to add one more line:
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NO_STATUS_BAR,
WindowManager.LayoutParams.FLAG_NO_STATUS_BAR);
translate by forverlove:
设置android 全屏,需要两步:1,去掉标题,2,去掉状态栏
1,去标题
在onCreate()事件中 添加 代码
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
2,去状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NO_STATUS_BAR,
WindowManager.LayoutParams.FLAG_NO_STATUS_BAR);
但是后来试过之后发现只要一句就可以了
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
而且WindowManager.LayoutParams.FLAG_NO_STATUS_BAR也没有这个属性