Android hides the pitfalls in the top Status Bar and the top Status Bar of android
Hide the pitfalls in the top status bar in Android
First, let's look at the general method of hiding the status bar:
Method 1:
@ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); // remove the title requestWindowFeature (Window. FEATURE_NO_TITLE); // remove the status bar getWindow () above the Activity (). setFlags (WindowManager. layoutParams. FLAG_FULLSCREEN, WindowManager. layoutParams. FLAG_FULLSCREEN); setContentView (R. layout. video_view); initView ();}
Pit 1: the code above to hide the top status bar must be placed in setContentView (R. layout. video_view). This method does not work many times before. Therefore, the second method is recommended.
Method 2:
<activity android:name="*.Activity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" ></activity>
Put: android: theme = "@ android: style/Theme. NoTitleBar. Fullscreen" in a separate Activity, which is only valid for the current Activity. To put the entire APP into the Application
Pit2: android: theme = "@ android: style/Theme. noTitleBar. fullscreen "if this line of code is configured in the Application, the entire APP Activity can only inherit from the Activity, not AppCompatActivity, because the Theme under AppCompatActivity can only be ActionBar;
Pit3: android: theme = "@ android: style/Theme. noTitleBar. if the Fullscreen line of code is set to only one Activity, you only need to ensure that the current Activity does not inherit the Activity rather than AppCompatActivity;