When I run the debugger I can look that ContextMenuInfo menuInfo variable from the method onCreateContextMenu and see that it holds the id of the list item that was long pressed on but how can I get that value to use?
EDIT
here is where i need the information
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){
if(mNum == 1){
menu.setHeaderTitle("Incident List Menu");
menu.add(Menu.NONE,6,0,"- Take Photo");
menu.add(Menu.NONE, INCIDENT_DELETE, 1, "- Delete");
menu.add(Menu.NONE, INCIDENT_DELETE_ALL, 2, "- Delete All");
}else if(mNum == 2){
Cursor c = getActivity().getContentResolver().query(StatusList.STATUS_URI,new String[] {StatusList.STATUS_PERMISSIONS},StatusList.STATUS_ID+"="+, selectionArgs, sortOrder)
Log.d("MainActivity", "status list");
}else if(mNum == 3){
menu.setHeaderTitle("Distribution List Menu");
menu.add(Menu.NONE, DL_DELETE, 0, "- Delete");
menu.add(Menu.NONE, DL_DELETE_ALL, 1, "- Delete All");
}else if(mNum == 4){
}else if(mNum == 5){
}
}
I need the ID here to make a query
Cast the supplied
ContextMenuInfoobject to be anAdapterView.AdapterContextMenuInfoobject, then useinfo.positionorinfo.idor whatever.