Volley - NetworkImageView sometimes doesn't show the error image?

前端 未结 1 1471
北恋
北恋 2021-01-20 16:49

So I\'ve decided to try out the new Volley library as shown on Google IO 2013.

I\'ve tried it out while using the easy solution of NetworkImageView to s

相关标签:
1条回答
  • 2021-01-20 17:40

    I think the problem is that the volley does not help you to reload the image.

    A quick inspection shows that the NetworkImageView only loads data when onLayout method is called and the method loadImageIfNecessary will queue the network request if necessary.

    When there is no Internet connection, the error callback will be called and there is no further action once the Internet get itself connected.

    However, since you have the NetworkImage in a list, when you scroll the list, I suppose you will reuse the cell view and call setImageURL once again. If the Internet connection is available, the image will be loaded automatically. Alternatively, once the Internet connection is up, you can refresh the list view and so that the image will be loaded automatically.

    0 讨论(0)
提交回复
热议问题