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?
Asked
Active
Viewed 39 times
0
-
Use Recycler View Instead of ListView – Ankit Tale Mar 13 '20 at 11:53
-
so listview doesn't have this feature? – Maheen Saleh Mar 13 '20 at 16:28
-
No, recyclerview is better one – Ankit Tale Mar 14 '20 at 17:37
1 Answers
0
Use Recycler View
and when the data change in fragment / activity you can add adapter.notifyDataSetChanged();
to update your list

Ilham Bagoes T.
- 38
- 1
- 6
-
maybe you can check this one https://stackoverflow.com/questions/2250770/how-to-refresh-android-listview – Ilham Bagoes T. Mar 16 '20 at 02:48