1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| private class DataAdapter extends ArrayAdapter<DP>
{
private ArrayList<DP> items;
public DataAdapter(Context context, int textViewResourceId,ArrayList<DP> items) {
super(context, textViewResourceId, items);
this.items = items;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
if(convertView == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = vi.inflate(R.layout.lv_dp_normal, null);
}
DP dp = this.items.get(position);
if(dp != null)
{
TextView name = (TextView)convertView.findViewById(R.id.dp_name);
if(name != null)
name.setText(dp.getName());
}
return convertView;
}
} |
Partager