I have a ListActivity with a list of names (Jacob, Will, Matt, etc.). I have a contextMenu which gives the user the option to edit or delete the person. I know how to find the id to perform the edit and delete functionality, but I can't figure out how to get the person's name to be added to the intent extras or to add a toast when a delete occurs.
Here is a snippet of code that I'm using for the context menu:
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch(item.getItemId()) {
case DELETE_ID:
mDbHelper.deletePerson(info.id);
fillData();
return true;
case EDIT_ID:
Cursor c = mCursor;
c.moveToPosition(info.position);
Intent i = new Intent(this, PersonEdit.class);
i.putExtra("_id", info.id);
startActivityForResult(i, ACTIVITY_EDIT);
return true;
}
return super.onContextItemSelected(item);
}