Thursday, 19 September 2013

getting id in context menu

getting id in context menu

I have seen multiple posts regarding this but after all those solutions I
stiil have this weird issue. I have implemented the following
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
.getMenuInfo();
int index = info.position;
Log.i(TAG,"onContextItemSelected id:"+String.valueOf(index));
}
I still get id as 0,1,2,.. and not the actual database row id. I am
implementing list item click listener as well and here I get the correct
row id based on the row. Is there something that I am missing.

No comments:

Post a Comment