标签:
class MyAdapter extends BaseAdapter { @Override public int getCount() { return arrayList.size(); } @Override public Object getItem(int i) { return null; } @Override public long getItemId(int i) { return 0; } @Override public View getView(int i, View view, ViewGroup viewGroup) { View lv = View.inflate(getApplicationContext(), R.layout.list_item, null); TextView textView2 = (TextView) lv.findViewById(R.id.textView2); TextView textView3 = (TextView) lv.findViewById(R.id.textView3); TextView textView4 = (TextView) lv.findViewById(R.id.textView4); Person person = arrayList.get(i); textView2.setText(String.valueOf(person.getId())); textView3.setText(person.getName()); textView4.setText(String.valueOf(person.getAge())); return lv; } }
标签:
原文地址:http://www.cnblogs.com/linson0116/p/4914229.html