Hi guys I am trying to add icons to the list of items in my context menu triggered when the user long clicks on a list view item.
The list is displaying fine along with the context menu, the only thing I seem to be having difficulty with is setting the icons. This is my context menu xml file.
<item android:id="@+id/delete_item" android:title="Delete" android:icon="@drawable/delete" />
<item android:id="@+id/edit_item" android:title="Edit" android:icon="@drawable/edit"/>
The only thing I wonder that might be throwing it off is perhaps the image sizes, do they have to be a specific size?
@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Options");
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context_menu, menu);
}