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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top