Search code examples
androidlistviewandroid-listview

Updating a single row in Android ListView every millisecond from ArrayAdapter


I have a ListView and ArrayAdapter set on it. My ListView single row contains TextView and start Button. When click on button the TextView text will be changed every millisecond. I have defined timer for it but when I change TextView text it doesn't appears on my view. It changes only when I call notifyDataSetChanged. But in this case calling notifyDataSetChanged every millisecond, my ListView is crashed. How can I solve this problem? In addition to I want to say that I implemented ArrayAdapter with ViewHolder pattern and overrided all necessary methods.


Solution

  • you should use RecyclerView it is a A flexible view for providing a limited elements into a large data set. so you can use it to control how many items should Be loaded on particular conditions. you can read about the RecyclerView here