可以做一个数据相对应的pojo类 列如Student.java 设置姓名、学号、成绩私有属性的set、get方法,重写toString方法
public class ListViewTest extends Activity{
private ListView lv;
private List stus;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
stus=new ArrayList();
stus.add(new Student(1001,"zhangsan",20,85));
stus.add(new Student(1002,"lisi",21,87.5));
stus.add(new Student(1003,"wangwu",22,88));
stus.add(new Student(1004,"zhaoliu",20,75));
stus.add(new Student(1005,"qianqi",21,97.5));
stus.add(new Student(1006,"liuba",22,68));
setContentView(R.layout.list_view_test);
lv=(ListView)findViewById(R.id.list_view_01);
List