public class MyAdapter extends ArrayAdapter<MyData> { private Context context; private int resource; private MyData[] objects; private int resTitle; private int resNumber;
public MyAdapter(Context context, int resource, MyData[] objects) { super(context, resource, objects); this.context = context; this.resource = resource; this.objects = objects; this.resTitle =R.id.title; this.resNumber =R.id.number; } public MyAdapter(Context context, int resource, int resTitle, int resNumber, MyData[] objects) { super(context, resource, objects); this.context = context; this.resource = resource; this.resTitle = resTitle; this.resNumber = resNumber; this.objects = objects; }
private static class ViewHolder { TextView title; TextView number; }