문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top