In my app I was prefetching images so they load faster when user scrolls using prefetchToBitmapCache
. Now when user applies a filter, these prefetches remain in pipeline and slow down the loading of new images.
How I am prefetching: When use scrolls down through images, I prefetch X number of images after LinearLayoutManager.findLastVisibleItemPosition()
's value. I need a way to cancel all these prefetches when user applies a filter. Is there a way to do this or a better way of prefetching?