First look at the general way to hide the status bar:
Method One:
@Override
protected void onCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Remove TITLE
requestwindowfeature (window.feature_no_title);
Remove the status bar
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Setcontentview (R.layout.video_view);
Initview ();
}
Pit 1: The code in the above setting hides the top status bar must be placed in Setcontentview (R.layout.video_view);
Method Two:
<activity
android:name= "*. Activity "
android:theme=" @android: Style/theme.notitlebar.fullscreen ">
</activity>
Will: Android:theme= "@android: Style/theme.notitlebar.fullscreen" This line of stacking is only valid for current activity in a separate activity, If you want the entire app to work, put it in application.
Pit 2:android:theme= "@android: Style/theme.notitlebar.fullscreen" This line of code, if configured in application, The entire app activity can only be inherited from the activity, cannot be appcompatactivity, because the appcompatactivity under the theme can only be actionbar style;
Pit 3:android:theme= "@android: style/ Theme.NoTitleBar.Fullscreen if this line of code is set only under one activity, then the other activity is arbitrary as long as it is ensured that the current activity is not an inheritance activity rather than an inherited appcompatactivity;
The above is a small series to introduce the Android hidden top status bar encountered problems, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!