FileDocCategorySizeDatePackage
List14.javaAPI DocAndroid 1.5 API17709Wed May 06 22:41:08 BST 2009com.example.android.apis.view

List14

public class List14 extends android.app.ListActivity
Demonstrates how to write an efficient list adapter. The adapter used in this example binds to an ImageView and to a TextView for each row in the list. To work efficiently the adapter implemented here uses two techniques: - It reuses the convertView passed to getView() to avoid inflating View when it is not necessary - It uses the ViewHolder pattern to avoid calling findViewById() when it is not necessary The ViewHolder pattern consists in storing a data structure in the tag of the view returned by getView(). This data structures contains references to the views we want to bind data to, thus avoiding calls to findViewById() every time getView() is invoked.

Fields Summary
private static final String[]
DATA
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setListAdapter(new EfficientAdapter(this));