0
I’m working on a college project where I use a database and a Listview. The problem is when I need to recover the data from one of the Listview items, as I cannot synchronize the Listview Ids with the BD Ids. In this case, if I register some items in the BD and then remove them, the Listview Ids no longer match those of the BD, making it an error when removing or viewing.
Is there any way to tie Listview items to a unique ID, which does not change if the order or quantity of Listview items changes?
How so
não consigo sincronizar os IDs da ListView com os IDs do BD
?– Math
If I create 2 items, in BD they are registered as 1 and 2. In Listview it is 0 and 1. So far it is quiet, but when I delete item 0, for example, the item that was 1 has ID 0, making it impossible to recover data from BD.
– Renan Lazarotto
Use the cursorAdapter, and whenever you delete an item from the list, reload it
– haroldolivieri