The data from the database is bound to the ListAdapter by means of a Cursor Object. Every item in the ListAdapter is a different row from the database
If you want to get the _id value of a certain row, select an item in the List and just do:
int value = cursor.getInt(cursor.getColumnIndex("_id"));
I just re-read your post and to be a bit more clear:
I found that when dealing with listview and databases, use a "ListActivity" which supports 1 ListView and 1 ListAdapter. Use a SimpleCursorAdapter to bind the data from the database to the ListAdapter. Every item in the ListAdapter now holds a Cursor object, which basically is a pointer to a specific row in the database.
In my implementation I've saved a URI to an Image in my database and I can retrieve the URI with:
After that I can use that URI as data in my Intent to view the image.