[英]Samsung and android 2.2.1 shared pref issue
I'm writing my first app for android and I already faced a irritating bug on Samsung devices with android 2.2.1. 我正在为Android编写我的第一个应用程序,我已经在使用android 2.2.1的三星设备上遇到了一个令人恼火的错误。
http://code.google.com/p/android/issues/detail?id=14359 http://code.google.com/p/android/issues/detail?id=14359
The problem is that the shared preferences becomes inaccesible when you reinstall the app, because the directory with preferences is not deleted and new reinstalled version is not owner of the directory. 问题是重新安装应用程序时共享首选项变得不可用,因为不删除具有首选项的目录,并且新重新安装的版本不是目录的所有者。 What results in situation when there are lot of settins saved in shared_pref and user updates the app he lose all the settings and cannot save new one. 当shared_pref中保存了大量的设置并且用户更新应用程序时,会丢失所有设置并且无法保存新设置。
As these devices with this version of android are still big part of the market and I'm already aware of this bug I would like to find some workaround for this issue. 由于这个版本的Android设备仍然是市场的重要组成部分,我已经意识到这个错误,我想找到一些解决这个问题的方法。
On rooted devices I can perform chown to solve the problem. 在root设备上,我可以执行chown来解决问题。 Does anybody has an idea how to solve it on non-rooted devices (without migrating all setings to sql database)? 有没有人知道如何在非root设备上解决它(没有将所有setings迁移到sql数据库)?
I was thinking about manually deleting the directory when I'm still its owner, but the problem is when to do it? 当我还是它的主人时,我正在考虑手动删除目录,但问题是什么时候这样做? Is there any intent on app uninstall or update? 有没有关于应用程序卸载或更新的意图?
Is there any intent on app uninstall or update? 有没有关于应用程序卸载或更新的意图?
Update, yes, but this problem should not exist on an update. 更新,是的,但更新不应存在此问题。 A regular update does not uninstall and reinstall the app, so the bug should not be triggered. 定期更新不会卸载并重新安装应用程序,因此不应触发该错误。
You do not get control at uninstall time. 您无法在卸载时获得控制权。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.