I'm attempting to use a ContextMenu.
I've successfully done this for a simple ListActivity using SimpleCursorAdapter.
Moving on I want to replace SimpleCursorAdapter with CursorAdapter but still retain the ContextMenu behaviour, so I've added the two mandatory override functions bindView and newView
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = mLayoutInflater.inflate(R.layout.check_row, parent, false);
registerForContextMenu(view);
return view;
}
Note the registerForContextMenu which replaces the registerForContextMenu(getListView()) in the onCreate method of the ListActivity. I found this necessary to get a call to onCreateContextMenu(...)
All this works (rows created with the expected widgets, callbacks on them working etc etc). All that is except that the ContextMenuInfo parameter supplied to onCreateContextMenu(...) is now null - stopping me accessing the rowId.
Is there another trick to perform - perhaps in the bindView(...) method of the CursorAdapter?