I have created a popup-menu
and want to change the text of each item in the menu
to blue. I have not created a style for the popup-menu
.
Menu Items
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/Meaning"
android:title="TOOL 29 - MEANING"/>
<item
android:id="@+id/ShiftState"
android:title="TOOL 30 - SHIFT STATE"/>
<item
android:id="@+id/Recreate"
android:title="TOOL 31 - RECREATE"/>
<item
android:id="@+id/Rules"
android:title="TOOL 32 - RULES"/>
</menu>
Code For Menu
btnEmotionTools = (ImageView) findViewById(R.id.btnEmotionTools);
btnEmotionTools.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PopupMenu popup = new PopupMenu(Screen2_Witnessing.this,btnEmotionTools);
popup.getMenuInflater().inflate(R.menu.popup_menu_emotion_tools, popup.getMenu());
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
itemId = item.getItemId();
if ( itemId == R.id.Meaning ){
screen = "2";
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Screen,screen);
editor.commit();
calculate();
Intent i = new Intent(getApplicationContext(), Screen109_Meaning.class);
startActivity(i);
}
else if ( itemId == R.id.ShiftState ) {
screen = "2";
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Screen,screen);
editor.commit();
calculate();
Intent i = new Intent(getApplicationContext(), Screen125b_Shift_State.class);
startActivity(i);
}
else if ( itemId == R.id.Recreate ) {
screen = "2";
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Screen,screen);
editor.commit();
calculate();
Intent i = new Intent(getApplicationContext(), Screen138_Recreate.class);
startActivity(i);
}
else if ( itemId == R.id.Rules ) {
screen = "2";
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Screen,screen);
editor.commit();
calculate();
Intent i = new Intent(getApplicationContext(), Screen122_Rules.class);
startActivity(i);
}
return true;
}
});
popup.show();
}
});