It is easy for Android to remove the title bar and full screen. There are two common methods:
First: Implemented in program code
Java code
This. requestwindowfeature (window. feature_no_title); // remove the title bar this. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen); // remove the Information bar this. requestwindowfeature (window. feature_no_title); // remove the title bar this. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen); // remove the Information bar.
Note: The two lines of code should be written before the page is displayed, that is, before setcontentview (R. layout. XXX ).
Second, the Android: Theme tag is implemented in the androidmanifest. xml configuration file.
Java code
<Activity Android: Name = "activity1" Android: theme = "@ Android: style/theme. notitlebar. fullscreen"> </activity>
Note: If you do not need full screen, you only need to write Android: theme = "@ Android: style/theme. notitlebar.
Summary: differences between the two
If the first method is used, a short title bar and Information bar will appear when the activity is started, and then disappear.
This is not the case if you use the second method. You are recommended to use the second method, which looks smoother.