Why shared preferences has been reset up on app crash or force close Android

前端 未结 1 660
悲哀的现实
悲哀的现实 2021-01-23 12:41

I have taken CSIPSIMPLE code and repackaged to com.mycompany.appname

The problem is, whenever app is crashed, All values are deleted from Shared preferences.

Why

相关标签:
1条回答
  • 2021-01-23 13:18

    This is common issue that many have faced including myself. Have a look at this post Android - Shared Preferences are lost sometimes which shares your findings.

    I would recommend not storing persistent data across shared preferences and rather use something like a database table to store settings.

    0 讨论(0)
提交回复
热议问题