Your Apps performance is a crucial element of the user experience. Try to avoid bad performing patterns like doing work on the UI thread and learn how to write fast and responsive apps.
Save View lookups with the ViewHolder pattern
Especially in a
ListView, you can run into performance problems by doing too many
findViewById() calls during scrolling. By using the
ViewHolder pattern, you can save these lookups and improve your
If your list item contains a single
TextView, create a
ViewHolder class to store the instance:
While creating your list item, attach a
ViewHolder object to the list item:
Using this pattern,
findViewById() will only be called when a new
View is being created and the
ListView can recycle your views much more efficiently.