Maheen Saleh
Maheen Saleh

Reputation: 183

AndroidStudio - ListView Adapter Update

Can listview adapter in JAVA for android studio update itself when a new data is added to it. like if i have an activity that sends a message and the sent message is displayed on the same activity, so whenever i send a message and add it to my adapter,will it update my listview on the spot or i need to refresh the current activity?

Upvotes: 0

Views: 41

Answers (1)

Ilham Bagoes T.
Ilham Bagoes T.

Reputation: 38

Use Recycler View and when the data change in fragment / activity you can add adapter.notifyDataSetChanged(); to update your list

Upvotes: 0

Related Questions