i have an arrayaadapter where i am retrieving the phone contacts numbers with images and displaying it in the list.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
LayoutInflater inflater = (LayoutInflater) (getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE));
view = inflater.inflate(renderer, null);
}
TextView text = (TextView) view.findViewById(R.id.name);
TextView textContNo = (TextView) view.findViewById(R.id.contactno);
TextView textEmailId = (TextView) view.findViewById(R.id.emailId);
Profile contact = listCont.get(position);
text.setText(contact.getName());
QuickContactBadge photo = (QuickContactBadge ) view.findViewById(R.id.quickContactBadge1);
photo.setTag(contact.getMobileNo());
new LoadImage(photo).execute(contact.getMobileNo());
and loading the images in backgroundthread using asyncTask
class LoadImage extends AsyncTask<String, Void, Bitmap>{
private QuickContactBadge qcb;
public LoadImage(QuickContactBadge qcb) {
this.qcb= qcb;
}
@Override
protected Bitmap doInBackground( final String... params) {
activity.runOnUiThread(new Runnable() {
public void run() {
new QuickContactHelper(activity, qcb, (String) params[0]).addThumbnail();
}
});
return null;
}
@Override
protected void onPostExecute(Bitmap result) {
}
}
i face two problems , the images are repeating and scrolling is not smooth iam trying to implemente viewholder in getview method but not sure how to use it or is there any other way to stop images from repeating. Any help is appreciated