In my chat application I have one base adapter which is not refresh at a time
so i want to refresh my base adapter in post button button click
when i am click on post button same time list view refreshed and also
refreshed my base adapter and display send message at a time.
Asked
Active
Viewed 74 times
-1

Akhil0181
- 14
- 8
-
Possible duplicate of [notifyDataSetChanged example](http://stackoverflow.com/questions/3669325/notifydatasetchanged-example) – yennsarah Nov 09 '15 at 13:18
-
In this case notifyDataSetChanged not working for me if any other way to refresh adapter than suggest me. – Akhil0181 Nov 09 '15 at 13:45
-
how can we suggest a way to improve your code if we can't see what you've got so far? – Bö macht Blau Nov 09 '15 at 14:02
2 Answers
1
You can do this by calling notifyDataSetChanged method. Find more about this at developers forum FYI pasting the link below
Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.

Triode
- 11,309
- 2
- 38
- 48
-
public void notifyDataSetChanged () not working please give me any other way to refresh my adapter. – Akhil0181 Nov 09 '15 at 13:46
0
Get the new data in your data structure like arraylist and then to update the view like listview call simply
**call youradapter.notifyDataSetChanged();**

Androider
- 3,833
- 2
- 14
- 24