1. directly set the activity topic to full screen mode in the androidmanifest. xml file.
Android: theme = "@ Android: style/theme. notitlebar. fullscreen"
For example, in the newgame view, the full screen display method is as follows:
<Activity Android: Name = "newgame"
Android: theme = "@ Android: style/theme. notitlebar. fullscreen"/>
SecondCodeFull Screen
1. Hide the title bar
Requestwindowfeature (window. feature_no_title );
2. Hide the status bar
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );
For example, in the newgame view, the full screen display method is as follows:
Requestwindowfeature (window. feature_no_title );
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );
Getwindow (). addflags (windowmanager. layoutparams. flag_keep_screen_on );
Setrequestedorientation (activityinfo. screen_orientation_portrait );
Setcontentview (R. layout. newgame );
Note:When using this method, you need to execute the above two methods before setcontentview.
======================
Full ScreenAfter:
========================
Full ScreenBefore: