Check value to disable/enable Context Menu Item (android)
android, contextmenu
Solution
AdapterView.AdapterContextMenuInfo info=(AdapterView.AdapterContextMenuInfo)menuInfo();
Then, `info.id` is the `_ID` of whatever item was long-tapped in your ListView.
Problem
In my application has a ListView. When long press on item the "Context Menu" will appear. I want to check the data ID, then set disable/enable to my Context Menu "Items". I can not find out the function like getMenuInfo() 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); } ```