I am showing the list of contacts .All good except that device has 1620 contacts so list is scrolling very slow and even sometimes get hangs.
Please help me out.
I tried using a check in getView method for ConvertView!=null
but it alwayz inflate same view many times. thanks in advance..
My code for getView method:-
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")));
}
}
}