How would one find the position of a specific item within a ListView? (Populated by SimpleCursorAdapter).
The reason I ask: The listview is set to singleChoice mode. Whe
When you say, "...reselecting the item in the activity's onCreate method...", do you mean that when the user returns to the ListView activity, whatever item was previously chosen, is now currently at the top of the screen (assuming enough items appear in the list below it)?
If so, then from onListItemClick, you should also make an effort to save the value of position
, since it tells you the position in the list of the selected item. This would allow you to not need to reverse-lookup the position from the _id
.
Or is that for some reason not an option for your purposes? Do you really need to instead figure out the position from the _id
?