F
F
fromthesecond2015-03-01 15:06:46
Android
fromthesecond, 2015-03-01 15:06:46

SimpleCursorAdapter for ListView and DB. How to use?

I'm afraid to seem stupid, but after reading about SimpleCursorAdapter I didn't understand anything.
Actually, I want to implement a trivial thing: there is a database with data, I want to fill the listview with this data, but in such a way that by clicking on the element, the corresponding entry from the database by id would be taken.
I used ArrayAdapter for a very long time to compile a listview, everything worked until I implemented deletion from the database. After deletion, the list collapsed and NullPointerExeption or links not to the correct data fell.
I read that it would be more correct to use SimpleCursorAdapter. Please explain briefly how it works or give a link to the available man. Everything I found was overflowing with unnecessary code and not at all clear. Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question