I’m trying to add an icon to menu items.
This does not work:
android:icon="@android:drawable/ic_menu_save"
android:drawableLeft="@android:drawable/ic_menu_save"
Could I be doing sth wrong?
xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/delete"
android:icon="@drawable/ic_menu_save"
android:title="@string/delete" />
</menu>
java:
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context_menu, menu);
}
try this :
android:icon=”@drawable/ic_menu_save”
also check this link will help :
http://www.tanisoft.net/2010/09/android-context-menu-with-icon.html
hope this help