0

I'm kinda new to Android Programming. I'm trying to create a list of several objects. Each list item should look like this:

 _________________________________________
| Title Text View           | Edit |Delete|
| Secondary Title Text View |Button|Button|

Each list item represent an object which was read from a database. My question is, how do I keep the list dynamic according to additions, edits and deletes, which the user can perform? I thought about reading the database into an array and then using array adpater, and when the programs finishes, writing it back into the database, but I cannot match the objects' fields into each text view (or atleast I don't know how). I'm sorry if my question seems stupid, I'm really new to android.

1 Answer 1

1

I think what you want to do is create an adapter which holds the data that you got from the DB.

The data will be displayed using a ListView (this is the part that will display your attached sketch).

After you change the data in the DB, you should refresh the adapter using:

yourAdapter.notifyDataSetChanged();

So your ListView will reflect the changes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.