Home  >  Q&A  >  body text

android - SharedPreferences在手机清理垃圾时候会被删除吗?

有些东西需要保存在数据库里,但是感觉数据库有点麻烦,想存到SP里面,但是又疑惑Sp什么时候会被删除掉呢?比如说用安全卫士等软件清理手机的时候会被删除么?

ringa_leeringa_lee2712 days ago823

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:38:26

    1.SharedPreferences are stored in the private directory of the application. Under normal circumstances, other applications have no operation permission. No need to worry.
    2. Uninstalling the application or clearing application data in the system settings will clear SharedPreferences.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:38:26

    No. This is application data, not garbage. It will only be deleted when uninstalling the APP

    reply
    0
  • PHPz

    PHPz2017-04-17 17:38:26

    No, the way to clean up junk on your phone is usually to clean up the cache folder. The Xml file saved by sp will be deleted when the APP is uninstalled.

    reply
    0
  • Cancelreply