FileDocCategorySizeDatePackage
IconListAdapter.javaAPI DocAndroid 1.5 API2454Wed May 06 22:42:46 BST 2009com.android.mms.ui

IconListAdapter

public class IconListAdapter extends android.widget.ArrayAdapter
An adapter to store icons.

Fields Summary
protected android.view.LayoutInflater
mInflater
private static final int
mResource
Constructors Summary
public IconListAdapter(android.content.Context context, List items)


      
              
        super(context, mResource, items);
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
Methods Summary
public android.view.ViewgetView(int position, android.view.View convertView, android.view.ViewGroup parent)

        TextView text;
        ImageView image;

        View view;
        if (convertView == null) {
            view = mInflater.inflate(mResource, parent, false);
        } else {
            view = convertView;
        }

        // Set text field
        text = (TextView) view.findViewById(R.id.text1);
        text.setText(getItem(position).getTitle());

        // Set resource icon
        image = (ImageView) view.findViewById(R.id.icon);
        image.setImageResource(getItem(position).getResource());

        return view;