Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onCreateContextMenu(ContextMenu menu, View v,
- ContextMenuInfo menuInfo) {
- super.onCreateContextMenu(menu, v, menuInfo);
- menu.add(0, v.getId(), 0, "Edit");
- menu.add(0, v.getId(), 0, "Delete");
- menu.add(0, v.getId(),0,"Cancel");
- }
- public boolean onContextItemSelected( MenuItem item){
- super.onContextItemSelected(item);
- if(item.getTitle()=="Delete"){
- AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
- //find the position of row
- long id= getListView().getItemIdAtPosition(info.position);
- //please write the code here how to get subitem id
- }
- }
- int itemId = item.getItemId();
Add Comment
Please, Sign In to add comment