Download and Save Images Using Picasso

前端 未结 3 725
轻奢々
轻奢々 2021-02-05 11:36

I\'m trying to show my news in a custom ListView. Each news is included of some images and I want to

3条回答
  •  盖世英雄少女心
    2021-02-05 12:19

    although this post is old, it seems the question hasn't been answered yet. Reading your code, it appears the call you make to picasso could be asynchronous. You should definitely check that, as if it is the case, you are starting image.length tasks, changing the filename at each new task, leading all tasks to complete and save to the last filename that was set. To solve this, you should override Target constructor and add a filename parameter so it's ready when the task ends, in your onBitmapLoaded listener.

提交回复
热议问题