第一种方法:
在onCreate(){
.................
..................
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
// remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
第二种方法:
在AndroidManifest.xml文件中添加android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
<activity android:name=".test"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>