Issue
So im creating a texting UI for android. The way its handling message threads is that when i hit send it sends the message, creates a new message thread and then adds this message to the corresponing instance of my conversation view.
ConverseView is an activity that only has an onCreate(Bundle) method. This method creates an adapter and populates the adapter with values from a ArrayList. Array list gets a message added to it when the user hits send. However these do not show up in the views.
I believe that the problem is, the activity is being created then im adding a message, and the ListView is not updated. How can i fix this.
Solution
Use a ArrayAdapter adapter;
backed by an ArrayList
. To update the data in the list after modifying your ArrayList just call adapter.notifyDataSetChanged()
.
Answered By - K_Anas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.