Action Bar on Android is still showing despite using NoActionBar theme
Asked Answered
S

1

8

I am using the theme Theme.MaterialComponents.DayNight.NoActionBar (docs) for my Android app.

I am also calling getActionBar().hide() in the MainActivity.

On nearly all my devices, the Action Bar is not displaying. However on one device, a Pixel 6 running Android 12, I still see the Action Bar. I am sure I've installed the latest version of my app.

Any ideas why the Action Bar is still hanging around on this one device?

Swig answered 8/7, 2022 at 13:47 Comment(0)
R
6

I had the same problem (I thought) until I realized that I had set the .NoActionBar style in my values/themes.xml but NOT in my values-night/themes.xml and the device with the "issue" was in dark mode.

Solution: Set Theme.MaterialComponents.DayNight.NoActionBar in both values/themes.xml and values-night/themes.xml.

Redd answered 16/1, 2023 at 5:49 Comment(1)
this was my case !Conformity

© 2022 - 2024 — McMap. All rights reserved.