I have noticed that my app's SharedPreferences are completely reset if the app is force closed or is killed by the system for some reason. Obviously, yes, I should avoid having a crash in the first place but it does happen. If it does happen, the user shouldn't loss all of their settings and other data stored with the Preferences.
I found this thread on Google Groups but they couldn't solve it.
Anyone have any insight into why or how this happens and if there is a way to prevent it?
Also, fyi I have seen this on a 2.1 and a 2.2 device. It will happen on every crash, not just some of them.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…