简体   繁体   English

三星和Android 2.2.1共享pref问题

[英]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.

相关问题 清除Android应用程序中共享pref的数据 - clear data from shared pref in android app 在某些高端设备(如三星)中,共享的Pref返回错误的值 - Shared Pref returning wrong value in some high end devices like samsung 在Android上以编程方式安装Application而不删除DB和共享的pref文件 - Install Application programmatically on Android without deleting DB and shared pref file 如何在共享首选项中存储 Integer Arraylist 并在 Android/Java 中检索相同内容? - How to Store Integer Arraylist in Shared Pref and retrieve the same in Android/Java? Android ListView Edge Fading适用于2.2虚拟设备,但不适用于Samsung 2.2.1 - Android ListView Edge Fading works on a 2.2 virtual device but not on Samsung 2.2.1 如何将对象存储到Shared-Pref或Database:Android中? - How can I store object into Shared-Pref or Database : Android? 在运行任何 UI 测试 android 之前清除共享首选项数据 - Clear shared pref data before running any UI test android Android三星wifi问题 - Android Samsung wifi issue 三星Nougat 7.0共享元素过渡问题 - Samsung Nougat 7.0 shared element transition issue 使用共享首选项扩充视图 - Inflate a view using shared pref
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM