简体   繁体   中英

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.

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.

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.

On rooted devices I can perform chown to solve the problem. Does anybody has an idea how to solve it on non-rooted devices (without migrating all setings to sql database)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM