SoFunction
Updated on 2025-03-11

Problems encountered when Android hides the top status bar

Let’s take a look at the regular method of hiding the status bar:

Method 1:

@Override
protected void onCreate(Bundle savedInstanceState) {
(savedInstanceState);
//Remove titlerequestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove the status bar on the ActivitygetWindow().setFlags(.FLAG_FULLSCREEN,
.FLAG_FULLSCREEN);
setContentView(.video_view);
initView();
}

Pit 1: The code that sets the hidden top status bar above must be placed before setContentView(.video_view);

Method 2:

<activity
android:name="*.Activity"
android:theme="@android:style/" >
</activity>

Put: android:theme="@android:style/" in a separate activity, only valid for the current activity. If you want the entire APP to work and put it in the Application

Pit 2: If this line of code is configured in Application, the Activity of the entire APP can only be inherited from the Activity, and cannot be AppCompatActivity, because the Theme under AppCompatActivity can only be in the ActionBar style;

Pit 3: android:theme="@android:style/If this line of code is only set under a certain activity, then just make sure that the current activity does not inherit the Activity instead of the AppCompatActivity, and other activities are free;

The above is the problem encountered by the Android hiding the top status bar that the editor introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!