The first method is to directly write in the code.
Java code
Requestwindowfeature (window. feature_no_title );
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen,
Windowmanager. layoutparams. flag_fullscreen );
requestWindowFeature(Window.FEATURE_NO_TITLE);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
It must be set before the setcontentview method is called.
The second method defines a topic in styles. xml.
XML Code
<Resources>
<Style name = "theme. notitle_fullscreen">
<Item name = "Android: windownotitle"> true </item>
<Item name = "Android: windowfullscreen"> true </item>
</Style>
</Resources>
<resources> <style name="Theme.NoTitle_FullScreen"> <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> </style></resources>
In manifest. XML, add the Android: theme = "@ style/theme. notitle_fullscreen" attribute to the activity to be full screen.