title bar and status bar
The Android program, by default, contains the status bar and the title bar.
Create a new Android program in Eclipse, which appears as follows:
The figure shows the status bar (display time, battery level, network, etc.) and the title bar (which displays the name of the app, the property value of the activity's Android:label).
To hide the title bar and status bar, there are two ways to do this in general, one in code and one in the manifest file.
The methods set in the code are described below.
Set in Java code
Hide title bar:
public class Mainactivity extends activity{ @Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); This part of the content must be called before Setcontentview ()/ /Remove the window title requestwindowfeature (window.feature_no_title); Load Layout setcontentview (r.layout.activity_main);} }
The effect is as follows:
hide the title bar and hide the status bar so that activity is displayed in full screen :
Package Com.example.fullscreen;import Android.os.bundle;import Android.view.window;import Android.view.windowmanager;import Android.app.activity;public class Mainactivity extends activity{ @Override protected void OnCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); This part of the content must be called before Setcontentview ()/ /Remove the window title requestwindowfeature (window.feature_no_title); Hide status bar, full screen //First type: GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_FULLSCREEN); The second type: (Two ways effect) //GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); Load Layout setcontentview (r.layout.activity_main);} }
The effect is as follows:
Set in the manifest file
another way to set up a full screen: Set the style in the Androidmanifest.xml file ,
At this time, the activity code does not need to add any title and full-screen settings of the code, the effect is as follows:
Source: http://www.cnblogs.com/mengdd/p/3177284.html
Android Untitled fullscreen settings