Android fast Bitmap loading

前端 未结 4 1321
感情败类
感情败类 2021-02-06 09:21

I have a block of images that I want to load on my screen. All the images are files that I downloaded and stored on SD-CARD.

So far I found two ways to do it, first is l

4条回答
  •  别那么骄傲
    2021-02-06 10:12

    One way to do this will be to implement a kind of listener/observer.

    From your UI thread, launch other thread that will load the image. Once the image is loaded, thread will invoke a call back method implemented in the activity class to update the corresponding image view.

    Instead of android asynch task, I will go for my threads (pooled/Executors). I will get all the possible image paths before loading them, and dispatching them to thread loading the image.And in the call back I know where to updated the image.

    Alternatively you can also check how the Loader perform in your case.

提交回复
热议问题