I am trying to load images from the Internet using Universal Image Loader on a gridview using the below code.
public View getView(int position, View converView, ViewGroup parent) {
Log.v("Description", "Description is " + position);
ViewHolder mVHolder;
if (converView == null) {
LayoutInflater vi = (LayoutInflater) conted.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
converView = vi.inflate(R.layout.customgrid, null);
mVHolder = new ViewHolder();
mVHolder.mImageView = (ImageView) converView
.findViewById(R.id.imgview);
mVHolder.mTextView1 = (TextView) converView
.findViewById(R.id.textView1);
mVHolder.mTextView2 = (TextView) converView
.findViewById(R.id.textView2);
mVHolder.mTextView3 = (TextView) converView
.findViewById(R.id.textView3);
converView.setTag(mVHolder);
} else {
mVHolder = (ViewHolder) converView.getTag();
}
// mVHolder.mImageView.setImageResource(mThumbIds[position]);
// mVHolder.mImageView.setImageDrawable(LoadImageFromURL(
// mThumbIds[position]));
imageLoader.displayImage(mThumbIds[position],mVHolder.mImageView,options, animationListener);
Log.v("Names",NAMES[position] + STATES[position] + CONSTITUENCY[position]);
mVHolder.mTextView1.setText(NAMES[position]);
mVHolder.mTextView2.setText(STATES[position]);
mVHolder.mTextView3.setText(CONSTITUENCY[position]);
return converView;
}
However, when I scroll down in the list, the first image of the first row seems to repeat in most of the grids. It does not stay all the time - it changes back to the original image after a while. My question is, is this a issue with view inflation on gridview or image loading of Universal Image Loader?