We all know that there are two ways to implement certain features in Android: One is to set the corresponding attribute in the XML file, and the other is to implement it in code. Similarly, the Android implementation of full-screen display can also be achieved through both methods:
1, in the Androidmanifest.xml configuration file inside the <activity> tag add attributes:
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
2. Add the following two statements between super () and Setcontentview () two methods in the OnCreate () method of the activity:
This.requestwindowfeature (window.feature_no_title);//Remove the title bar
This.getwindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_ fullscreen);//Remove Information Bar
Example
Method One: <?xml version= "1.0" encoding= "Utf-8"? ><manifest xmlns:android= "http://schemas.android.com/apk/res/ Android "package=" Test.ts.wader.image "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk and roid:minsdkversion= "7"/> <application android:icon= "@drawable/ic_launcher" android:label= "@string/ App_name "> <activity android:label=" @string/app_name "Android:name=". Imagelistactivity "Android:theme=" @android: Style/theme.notitlebar.fullscreen "> <intent-filter > <action android:name= "Android.intent.action.MAIN"/> <category android:name= "Android.inte Nt.category.LAUNCHER "/> </intent-filter> </activity> </application></manifes T> Method Two: public class Imagelistactivity extends Activity implements Onitemclicklistener {@Override public void OnC Reate (Bundle savedinstancestate) {super.oncreatE (savedinstancestate); Requestwindowfeature (Window.feature_no_title); Set untitled GetWindow (). SetFlags (WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT); Set Full screen Setcontentview (r.layout.image_list_layout); }}
Transferred from: http://www.cnblogs.com/wader2011/archive/2011/11/19/2255045.html
How to display Android full screen (without status bar)