I would set an android.widget.Adapter
(perhaps a BaseAdapter
or ListAdapter
depending on your data) for the view to provide the data to the view. When the data is updated, simply call the adapter's notifyDataSetChanged()
method to update the view.
Proper way to listen to data changes, and update UI accordingly
-
30-09-2022 - |
Question
I'm storing numerical data (streamed from a Bluetooth connection running as a background Service
) on a static ArrayList
.
Every time my List
is modified, I need to update my UI accordingly (which is a plot on an Activity).
I've read about:
Which solution is the most appropriate? Is there any other better/simpler solution?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow