So I am developing a andriod application, and I was adding a menu, but I can’t change it’s color. I have read a lot of other stackoverflow questions and answers on this, and tried everything I found, but nothing helped. Here’s some of my xml files that should (to my knowledge) have some effect on this.
res/menu/main_menu.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_changelog"
android:title="@string/changelog" />
</menu>
res/values/themes/themes.xml:
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Base.Theme.AppName" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/night</item>
<item name="android:popupMenuStyle">@style/CustomPopupMenu</item>
</style>
<style name="CustomPopupMenu" parent="Widget.Material3.PopupMenu">
<item name="android:popupBackground">@color/dark_night</item>
<item name="android:itemBackground">@color/dark_night</item>
<item name="android:panelFullBackground">@color/dark_night</item>
</style>
<style name="Theme.MorseConvert" parent="Base.Theme.MorseConvert" />
</resources>
@color/night
@style/CustomPopupMenu
<style name="CustomPopupMenu" parent="Widget.Material3.PopupMenu">
<item name="android:popupBackground">@color/dark_night</item>
<item name="android:itemBackground">@color/dark_night</item>
<item name="android:panelFullBackground">@color/dark_night</item>
</style>
<style name="Theme.MorseConvert" parent="Base.Theme.MorseConvert" />
</resources>
This is how it looks:
As I said, I tried everything I could find, even using a new drawable, but nothing changed this.
I made sure I am using the right theme in AndroidManifest.xml
I tested this on an emulator and on a real device, and the result didn’t change.
I tred clearing cache and restarting andriod studio, but that didn’t help.