当我运行调试器时,我可以ContextMenuInfo menuInfo
从方法中查看该变量,onCreateContextMenu
并看到它保存了长时间按下的列表项的 id,但我怎样才能使用该值?
编辑 这里是我需要信息的地方
@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){
}
}
我需要这里的 ID 进行查询