Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <a href="http://developer.android.com/training/improving-layouts/smooth-scrolling.html" rel="nofollow">ViewHolder</a> pattern.</p> <p><a href="http://developer.android.com/training/improving-layouts/smooth-scrolling.html" rel="nofollow">http://developer.android.com/training/improving-layouts/smooth-scrolling.html</a></p> <p><strong>Hold View Objects in a View Holder</strong></p> <p>Your code might call findViewById() frequently during the scrolling of ListView, which can slow down performance. Even when the Adapter returns an inflated view for recycling, you still need to look up the elements and update them. A way around repeated use of findViewById() is to use the "view holder" design pattern.</p> <blockquote> <p>A ViewHolder object stores each of the component views inside the tag field of the Layout, so you can immediately access them without the need to look them up repeatedly. First, you need to create a class to hold your exact set of views. For example:</p> </blockquote> <pre><code>static class ViewHolder { TextView text; TextView timestamp; ImageView icon; ProgressBar progress; int position; } </code></pre> <blockquote> <p>Then populate the ViewHolder and store it inside the layout.</p> </blockquote> <pre><code>ViewHolder holder = new ViewHolder(); holder.icon = (ImageView) convertView.findViewById(R.id.listitem_image); holder.text = (TextView) convertView.findViewById(R.id.listitem_text); holder.timestamp = (TextView) convertView.findViewById(R.id.listitem_timestamp); holder.progress = (ProgressBar) convertView.findViewById(R.id.progress_spinner); convertView.setTag(holder); </code></pre> <p>Some other examples :</p> <p><a href="http://xjaphx.wordpress.com/2011/06/16/viewholder-pattern-caching-view-efficiently/" rel="nofollow">http://xjaphx.wordpress.com/2011/06/16/viewholder-pattern-caching-view-efficiently</a> <a href="http://www.jmanzano.es/blog/?p=166" rel="nofollow">http://www.jmanzano.es/blog/?p=166</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload