Hide those pits from the top status bar in Android
Let's look at the usual ways 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 above activity GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Setcontentview (R.layout.video_view); Initview (); }
Pit 1: The code above to set the hidden 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 work is only valid for the current activity in a separate activity, If you want the entire app to work, put it on 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 activity, cannot be appcompatactivity, because appcompatactivity under the theme can only be actionbar style;
Pit 3:android:theme= "@android: style/ Theme.NoTitleBar.Fullscreen This line of code if only set in a certain activity, so long as to ensure that the current activity is not to inherit activity rather than inherit appcompatactivity, other activity is arbitrary;
Hide those pits from the top status bar in Android