0

I have very strange behavior when ListView adapter provides into getView method the same convertViews even if all of them are visible: getView(); 0; holder: ViewHolder@4289bde8 getView(); 1; holder: ViewHolder@4289bde8 getView(); 4; holder: ViewHolder@4289bde8 getView(); 2; holder: ViewHolder@4289bde8 getView(); 3; holder: ViewHolder@4289bde8

It occurs only if I call setImageBitmap with async downloaded image. If this method is called with Bitmap that is static (e.g. Bitmap from Resources) - everything works as designed: getView(); 2; holder: ViewHolder@426fd408 getView(); 1; holder: ViewHolder@42899128 getView(); 0; holder: ViewHolder@4289bdf0 getView(); 4; holder: ViewHolder@4289b598 getView(); 5; holder: ViewHolder@4289b480

goRGon
  • 4,402
  • 2
  • 43
  • 45

1 Answers1

0

It became a big surprise for me, but the issue was related with my misprint, when I accidentally specified android:layout_height="wrap_content" for the ListView. Right after I changed it to a correct android:layout_height="match_parent" value, recycling mechanism started to work correctly even for async bitmaps!

goRGon
  • 4,402
  • 2
  • 43
  • 45