//创建自定义的MyAdapter对象
MyAdapter adapter=new MyAdapter(this,R.layout.list_item,list,from,to);
//调用ListView的setAdapter()方法设置适配器
listView.setAdapter(adapter);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
这几个头像是我自己下载的图片,其对应的资源地址在 MainActivity中用一个 photoRes数组表示的~










