There is a ListView in my application. A long press on an item displays the "Context Menu". I want to check the data identifier, and then set disable / enable to my Items menu. I cannot find the getMenuInfo () function or something like this.
@Override
public void onCreateContextMenu(ContextMenu menu , View v, ContextMenuInfo menuInfo)
{
super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, ADD_FAVORITE_ID, 0, "Check");
menu.add(0, ADD_FAVORITE_ID, 0, "UnCheck").setEnabled(false);
}
source
share