this is a big problem for me. i follow the solutions that i searched from the internet: modify the listview layout and list-item layou file, 'wrap_content' to 'fill_parent'. but 'getView' function always was voked many time when the value of the 'position' is 0; i think it is maybe due to my complexed layout file. so , i decide to give the a special way to load the data when 'position ' was 0; my solution like this:
if(position==0){ Bitmap bitmap = null; if(imageFetcher.mImageCache!=null){ bitmap = imageFetcher.mImageCache.get(entity.getPath()); if(bitmap!=null){ holder.imageView.setImageBitmap(bitmap); }else { bitmap = FileImageUtil.getImageLocal(entity.getPath(), 100, 100); if(bitmap != null){ imageFetcher.mImageCache.put(entity.getPath(), bitmap); holder.imageView.setImageBitmap(bitmap); }else { holder.imageView.setImageResource(R.drawable.image_broken); } } } }else { Log.d(TAG, "load position "+(position)+" ----- path "+entity.getPath()+" convertView "+convertView+" imageview " + holder.imageView); imageFetcher.loadBitmap(entity.getPath(), (position), 100, 100, holder.imageView); }
it works fine.