Prototik / HoloEverywhere

NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE.
MIT License
2.18k stars 608 forks source link

[BUG]Preferences reseted after a period of time #853

Open imoblife opened 9 years ago

imoblife commented 9 years ago

I don't know what's going on, but this may have sth. to di with it:

11-07 11:18:34.383: W/SharedPreferencesImpl(15678): getSharedPreferences 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): org.xmlpull.v1.XmlPullParserException: Map value without name attribute: float 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at com.android.internal.util.XmlUtils.readThisMapXml(XmlUtils.java:564) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:809) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:751) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:490) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at android.app.SharedPreferencesImpl.loadFromDiskLocked(SharedPreferencesImpl.java:120) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at android.app.SharedPreferencesImpl.access$000(SharedPreferencesImpl.java:52) 11-07 11:18:34.383: W/SharedPreferencesImpl(15678): at android.app.SharedPreferencesImpl$1.run(SharedPreferencesImpl.java:91) 11-07 11:18:34.401: W/Resources(15678): Converting to string: TypedValue{t=0x10/d=0x4 a=-1}

imoblife commented 9 years ago

Does it has sth. to do with using both android.content.sharedpreferences and org.holoeverywhere.content.sharedpreferences?

imoblife commented 9 years ago

getPreference(context).edit().putFloat(key, value).commit(); //key != null, or your entire shared preferences may be cleared!