简体   繁体   English

在 Android 中以编程方式清理应用程序数据的好方法

[英]Good approach to clean application data programmatically in Android

When I use RecyclerView and/or Picasso.当我使用 RecyclerView 和/或 Picasso 时。 It seems to cache and store alot of data in my application.它似乎在我的应用程序中缓存和存储了大量数据。 However, I want to delete the stored data and the cache in a simple way whenever I am exiting my app.但是,每当我退出我的应用程序时,我都想以一种简单的方式删除存储的数据和缓存。

  1. What is the simplest way to delete all data stored in your created app programmatically?以编程方式删除存储在您创建的应用程序中的所有数据的最简单方法是什么?
  2. What is the latest or the efficient way to tell Picasso to not store or cache images?告诉毕加索不要存储或缓存图像的最新或有效方法是什么?

Picasso has evictAll() API to clear cache. Picasso 有evictAll() API 来清除缓存。 Also you can set Picasso disk cache size to something small or zero.您也可以将毕加索磁盘缓存大小设置为较小或为零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM