0

I have a menu with groups that contain items. These items change color, including their icon, like visited links in HTML. I never specified this behavior or color (which I can't find in my resources at all).

Its applying a tint to the whole item, including the icon after I click on it. Here is my XML.

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group android:checkableBehavior="none">
        <item
            android:id="@+id/action_one"
            android:icon="@drawable/ic_one"
            android:title="@string/one"/>
        <item
            android:id="@+id/action_two"
            android:icon="@drawable/two"
            android:title="@string/two" />
    </group>

</menu>

I also don't see any attribute to stop this behavior? Do I have to modify an app theme or something to disable this? I want all of my items to have the same color, even after they are clicked on.

Tyler
  • 19,113
  • 19
  • 94
  • 151

1 Answers1

0

The issue was that the menu item was being selected programmatically, which I didn't realize was happening.

...

new NavigationView.OnNavigationItemSelectedListener() {
                @Override
                public boolean onNavigationItemSelected(MenuItem menuItem) {
//                    menuItem.setChecked(true); <-- was changing the color

...

Commenting out this line leaves the color as the default color.

Tyler
  • 19,113
  • 19
  • 94
  • 151