How To Find The Primary Key Of Select List
I have to show the name of my data on a listview, and don't show the primary key. Now when I click I will get name, but I want to get the primary key of the data that was clicked.
Solution 1:
you just sent position of list that you've selected to query method then query finally use moveToPosition() to move cursor to information that you want
Solution 2:
It can't be done in the setup you have at the moment. If you want to use an ArrayAdapter to show your data AND return the id, you need to wrap the items in a class which implements both toString() (to generate the label for display) and something like getId() (to get the id).
Post a Comment for "How To Find The Primary Key Of Select List"