我在recyclerview中使用毕加索是这样的:
Picasso.with(context).load(contects.get(position).getLogo()).memoryPolicy(MemoryPolicy.NO_CACHE )
.networkPolicy(NetworkPolicy.NO_CACHE).error(R.mipmap.ic_launcher).into(holder.ImageView);
但是我在毕加索日志上得到了这个:
D/Picasso: Main created [R0] Request{https://debo3.com/wp- content/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Dispatcher enqueued [R0]+11ms
D/Picasso: Hunter executing [R0]+14ms
D/Picasso: Main created [R1] Request{https://debo3.com/wpcontent/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Hunter joined [R1]+1ms to [R0]+17ms, [R1]+1ms
W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.example.ahmadi.khadamat/cache/picasso-cache/journal.tmp
D/Picasso: Main created [R2] Request{https://debo3.com/wp-content/uploads/2017/08/abstract-logo-template_1331-33.jpg}
D/Picasso: Hunter joined [R2]+1ms to [R0]+21ms, [R1]+5ms, [R2]+1ms
D/Picasso: Dispatcher retrying [R0]+20s, [R1]+20s, [R2]+20s
D/Picasso: Hunter executing [R0]+20s, [R1]+20s, [R2]+20s
D/Picasso: Dispatcher retrying [R0]+41s, [R1]+41s, [R2]+41s
D/Picasso: Hunter executing [R0]+41s, [R1]+41s, [R2]+41s
D/Picasso: Dispatcher batched [R0]+41s, [R1]+41s, [R2]+41s for error
D/Picasso: Dispatcher delivered [R0]+42s, [R1]+42s, [R2]+42s
D/Picasso: Main errored [R0]+42s
D/Picasso: Main errored [R1]+42s
D/Picasso: Main errored [R2]+42s
我认为这条线上的错误:
W/System.err: remove failed: ENOENT (No such file or directory) : /data/data/com.example.ahmadi.khadamat/cache/picasso-cache/journal.tmp
它适用于所有android版本,但不适用于android 5.1.1(平板电脑)(api 22)
最佳答案
添加此代码:
.memoryPolicy(MemoryPolicy.NO_STORE)
.networkPolicy(NetworkPolicy.NO_STORE)