There are two ways of doing this:
1, in the Androidmanifest.xml configuration file inside the <activity> tag add attributes:
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
Such as:
<activityandroid:name= "com.wangfeng.wfgogofish.ui.FirstActivity"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>
2. Add the following two statements between super () and Setcontentview () two methods in the activity's OnCreate () method:
this. requestwindowfeature (Window.feature_no_title); // Remove title bar this. GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_ fullscreen); // Remove Information Bar
Such as:
@Override publicvoid onCreate (Bundle savedinstancestate) { Super. OnCreate (savedinstancestate); // Set Untitled GetWindow (). SetFlags (WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT) ; // Set full screen Setcontentview (r.layout.image_list_layout); }
Android activity fullscreen