I have nested layouts with ImageViews inside. These are all inside a ScrollView. Initially, the ImageViews are set to a Drawable resource.
I used this solution to detect scrolls. It's called from inside a onTouchListener()
.
Android: Detect when ScrollView stops scrolling
Inside the scroll listener, I update the ImageViews to load Bitmaps from files.
There are times (about 1 in 10?) where the setImageBitmap
does noting. The Drawable resource is not replaced.
I tried the following:
* requestLayout()
after setImageBitmap()
* invalidate()
after setImageBitmap()
* posting the ImageView drawing logic to the UI thread separately