Android Ion Cache Refresh

天涯浪子 提交于 2019-12-04 09:03:46

You can append a unique string to your url for example a current timestamp in order to force Ion to treat each request as unique.

Use .noCache() to bypass caches.

As per documentation here, use the "long" way to build an ImageView request so that you can add headers, noCache, etc.

Change your original request from this:

Ion.with(imageView)
        .placeholder(R.drawable.ic_launcher)
        .error(R.drawable.ic_launcher)
        .load(urlString);

To this:

Ion.with(context)
        .load(urlString)
        .noCache()
        .withBitmap()
        .placeholder(R.drawable.ic_launcher)
        .error(R.drawable.ic_launcher)
        .intoImageView(imageView);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!