共享preferences不断消失 [英] shared preferences keep disappearing

查看:144
本文介绍了共享preferences不断消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的共享preferences存储登录我的应用程序凭据。除非一个用户一切正常。一定量的时间后,将共享preferences似乎是复位或以某种方式被清除。我已经调整了我的应用程序此用户永远不会明白他的共享preferences了。这样我可以肯定,这不是我的应用程序的错。但即使这样修改之后他的证件被清除,所以我怀疑别的东西是怎么回事,他的设备。

I'm using the shared preferences to store login credentials for my app. Everything works fine except with one user. After a certain amount of time the shared preferences seem to be reset or cleared somehow. I've adjusted my app for this user to never clear his shared preferences anymore. This way I can be sure that it is not my app's fault. But even after this modification his credentials get cleared, so I'm suspecting something else is going on with his device.

做任何你必须对如何处理这个问题的建议?我一直在思考如何创建另一个应用程序,它设置一个fileobserver监视preference文件。这样,我希望看到当文件被清除/删除。也许还有谁的应用程序已经可以做到这一点?我甚至愿意作出preference文件提供给其他应用程序检查。没有任何一个诊断此问题的方法吗?我敢肯定,这不是我的应用程序在做清算/复位...

Do any of you have suggestions on how to approach this problem? I've been thinking about creating another app which sets a fileobserver to monitor the preference file. This way I hope to see when the file gets cleared/deleted. Maybe there are apps who can do this already? I'm even willing to make the preference file available to other apps for checking. Is there any one way to diagnose this problem? I'm sure it's not my app doing the clearing / resetting...

感谢您的帮助,您可以给。

Thanks for any help you can give.

推荐答案

您只的有一个的这个问题的用户?有多少用户,你呢?至少100?如果是这样它可能是一个坏的设备。不要浪费时间追求这一点。

You have only one user with this problem? How many users do you have? At least 100? If so it's probably a bad device. Don't waste time chasing this.

这篇关于共享preferences不断消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆