Hello guys.. that s my baseAdapter getview implmentation:
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
int type = getItemViewType(position);
if (convertView == null) {
switch (type) {
case TYPE_BIG_NEWS:
convertView =
mInflater.inflate(R.layout.big_news, null);
break;
case TYPE_NORMAL_NEWS:
convertView =
mInflater.inflate(R.layout.normal_news, null);
break;
default:
break;
}
}
ImageView thumb = (ImageView)
convertView.findViewById(R.id.thumbId);
File f = null;
if (filename != null)
f = mFileCache.getFile(i.newsKey, filename);
if (f == null) {
if (mGetThumbsThread != null && filename !=
null) {
Log.i(TAG, "cache miss");
thumbLinks.offer(new
ThumbRequest(i.newsKey, i.thumbLink,
i.thumbName));
mGetThumbsThread.signal();
}
thumb.setImageResource(placeHolder);
} else {
Log.i(TAG,
"file bitmap cached: " +
f.getName() + " size: " + f.length() /
1024);
bitmap =
BitmapFactory.decodeFile(f.getAbsolutePath());
thumb.setImageBitmap(bitmap);
}
return convertView;
}
Every row is compound of text and an ImageView. Is there any chance to
recycle the bitmap I use in the getView?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en