我正在显示联系人列表。除了该设备有 1620 个联系人之外,一切都很好,因此列表滚动非常缓慢,甚至有时会挂起。
请帮帮我。
我尝试使用检查 getView 方法,ConvertView!=null
但它总是多次膨胀相同的视图。提前致谢..
我的 getView 方法代码:-
if(ConvertView==null)
{ view= mInflater.inflate(R.layout.facebookfriend, null);
TextView name=(TextView)view.findViewById(R.id.textView1);
ImageView image=(ImageView)view.findViewById(R.id.imageView1);
name.setText(mlist.get(position).get("name"));
String Id=mlist.get(position).get("contactId");
Log.e("Id",""+Id);
CheckBox chkbox= (CheckBox)view.findViewById(R.id.checkBox1);
chkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(
CompoundButton buttonView, boolean isChecked) {
isSelected.set(position, isChecked);
}
});
String photoid=mlist.get(position).get("photoId");
Log.e("photoid",""+photoid);
if(mlist.get(position).get("photoId")!=null){
Log.e("photoid",""+"photoid");
image.setImageBitmap(loadContactPhoto(Id, mlist.get(position).get("photoId")));
}
}
}