I have a popup menu that appears when the user clicks an image. The code used is:
PopupMenu popupMenu = new PopupMenu(mContext, mImageView);
popupMenu.setOnMenuItemClickListener(MyClass.this);
popupMenu.inflate(R.menu.menu_my_class_options);
popupMenu.show();
The menu has three actions, and I would like that the text in one of them to be colored red (instead of black).
Is that possible?
I've found some answers (e.g., here) that show how to do this with the activity's Options Menu, but they require access to the onCreateOptionsMenu
method...
Thanks in advance.
-- EDIT --
The menu file:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/item_edit"
app:showAsAction="ifRoom|withText"
android:title="@string/action_edit_address"
android:visible="true"/>
<item
android:id="@+id/item_retake_photo"
app:showAsAction="ifRoom|withText"
android:title="@string/action_retake_photo"
android:visible="true"/>
<item
android:id="@+id/item_delete"
app:showAsAction="ifRoom|withText"
android:title="@string/action_delete_shipment"
android:visible="true"/>
</menu>