How to get row id in onItemClick (ListView) when using custom adapter?

I searched for a while, but I could not find a solution.

Situation:

I use ListView, and I got the Cursorresult of SQLiteDatabase.query.

  • If I use SimpleCursorAdapterwhen you call onItemClick(AdapterView<?> parent, View view, int position, long id), the returned one idis the _id rows of this cursor

  • but if I use a special adapter, the return id works like an array [0,1,2,3], how can I set this identifier in the custom adapter?

thank

+2
source share
1 answer

, , getItemId(int pos). , , .

+6

All Articles