Android Full Screen Settings with no title, android full screen with no title
Title Bar and status bar
By default, the Android program contains the status bar and title bar.
Create an Android program in Eclipse. After running the program, it is displayed as follows:
The figure shows the status bar (display time, battery power, network, etc.) and the title bar (display the application name, that is, the android: label attribute value of activity ).
To hide the title bar and status bar, you can set either in the Code or in the manifest file.
The following describes how to set in the code.
Set in Java code
Hide the title bar:
Public class MainActivity extends Activity {@ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); // This part of content must be called before setContentView () // remove the Window title requestWindowFeature (Window. FEATURE_NO_TITLE); // load the layout setContentView (R. layout. activity_main );}}
The effect is as follows:
Hide the title bar and the status bar to display the Activity 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 content must be called before setContentView () // remove the Window title requestWindowFeature (Window. FEATURE_NO_TITLE); // hide the status bar and display it in full screen. // The first is getWindow (). addFlags (WindowManager. layoutParams. FLAG_FULLSCREEN); // Method 2: (two methods have the same effect) // getWindow (). setFlags (WindowManager. layoutParams. FLAG_FULLSCREEN, // WindowManager. layoutParams. FLAG_FULLSCREEN); // load the layout setContentView (R. layout. activity_main );}}
The effect is as follows:
Set in the Manifest File
Another way to set full screen is to set the style in the AndroidManifest. xml file.,
At this time, no title or full screen setting code needs to be added to the Activity code. The effect is as follows:
Source: http://www.cnblogs.com/mengdd/p/3177284.html