When you are working with CursorAdapter
in onItemClick(AdapterView<?> parent, View view, int position, long id)
implementation of AdapterView.OnItemClickListener
you can get:
- the
_id
column from the underlying Cursor - simply, it is thelong id
parameter of this function any column visible or not in your item view but existing in the Cursor by casting the item at position to the Cursor like:
Cursor c = (Cursor)parent.getItemAtPosition(position);
Now
c
is pointing to the selected row so you are can get any column from it as simple asvar value = c.getInt/String/etc(c.getColumnIndex("columnname"));