this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
注意:这两行代码要写在页面显示之前,即setContentView(R.layout.XXX)之前
第二:在AndroidManifest.xml配置文件中实现标签android:theme
<activity android:name="Activity1" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity>
注意:如果不需要全屏,只需要写成android:theme="@android:style/Theme.NoTitleBar即可