M
M
Maybe_V2016-04-13 23:53:04
Android
Maybe_V, 2016-04-13 23:53:04

How to update ExpandableListView when new record is added to db?

There is a button, when clicked, a record is added to the database. All records from the database are displayed in the ExpandableListView.
I update by calling the onResume() method when the button is clicked, while in it (in onResume() ) a selection from the database is again made. I understand that this is not practical and not optimal to do. How to do it right?
How to make it so that immediately after adding the database, a new record is displayed in the sheet?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Myvrenik, 2016-04-14
@prokopov-vi

In the list adapter, create a method that adds a new entry to the array and notifies you of data changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question