1
I have a listview where I list people’s names and when I click on a person I use the adapter.getitem(position)
who takes the person’s name, however, I needed to get the person’s id and not the name. Does anyone know how I can do this? Briefly I need to bring 2 database data, the name and the id, but present only the name in the listview and get the id when click. there are similar names, so I need the id.
BS: I’m currently doing something that I don’t know if it’s gambiarra or smart. list the names and when I click on the name uses the option to catch the id. For now it is working but is not a good practice.
How you are populating the Adapter of listview?
– Arubu
I’m using an Arrayadapter, I get a vector with the names of the bank and put in it.
– daniel12345smith
Is Pessoa an entity (class) with id and name? Are you passing an Array of People to your listview? Add more information, not knowing what I questioned becomes difficult to help.
– user28595