I have an ArrayAdapter holding a list of updating elements (e.g., a list of async-loaded news items).
What is the proper pattern so that, when an element’s value changes, it updates the View?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use methods like
ArrayAdapter#add(),ArrayAdapter#addAll(), etc. These will update the View that is bound to the adapter automatically.Or you can use the same methods on the List that the adapter reads and call
ArrayAdapter#notifyDataSetChanged()yourself.