平板电脑上 api 22(5.1.1) 的毕加索缓存错误
picasso cache error for api 22(5.1.1) on tablet
我在 recyclerview 中使用 picasso 是这样的:
Picasso.with(context).load(contects.get(position).getLogo()).memoryPolicy(MemoryPolicy.NO_CACHE )
.networkPolicy(NetworkPolicy.NO_CACHE).error(R.mipmap.ic_launcher).into(holder.ImageView);
但我在 picasso 日志上看到了这个:
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)
我在 recyclerview 中使用 picasso 是这样的:
Picasso.with(context).load(contects.get(position).getLogo()).memoryPolicy(MemoryPolicy.NO_CACHE )
.networkPolicy(NetworkPolicy.NO_CACHE).error(R.mipmap.ic_launcher).into(holder.ImageView);
但我在 picasso 日志上看到了这个:
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)