How to get rid of action bars in a splash activity

Asked 1 years ago, Updated 1 years ago, 104 views

To remove the action bar, in the onCreate() of the splash activity,

setContentView(R.layout.splash);
getActionBar().hide();

I did it like this. Maybe it's because I saw it before onCreate was called, but the action bar comes out and disappears. I don't want to show it at all. What should I do?

<item name="android:windowActionBar">false</item> I tried this, but it didn't work.

android android-actionbar

2022-09-21 15:49

1 Answers

If you use the V7 support action bar

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();

This will resolve the issue.


2022-09-21 15:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.