SharedPreferences bug when writing strings with ampersands in them

by » Sat, 07 Mar 2009 10:54:16 GMT

Sponsored Links
 Hi All,

I've just tracked down a weird bug in our app where SharedPreferences
were failing between power cycles of the phone.

It turns out that one of the strings we were saving had an "&" in it.
When I look at the xml that is being persisted I see that this is
being encoded as && instead of just &

This means that when you come to read the settings back you don't get
any values at all.

Is this a known issue? I see lots of posts about preferences
dissappearing, but nothing about this.



SharedPreferences bug when writing strings with ampersands in them

by Mark Murphy » Sat, 07 Mar 2009 23:09:14 GMT


Well, you posted an issue, so it's known now!


However, if you could attach some sample code to that issue that
demonstrates the bug, that may help get it resolved more quickly.

Mark Murphy (a Commons Guy) 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!


Sponsored Links

Other Threads

1. Accessing default "Messaging" settings

I am trying to access the default "Messaging" app's settings from my
app, and i would like to be able to modify those settings as well. But
I can't find any examples on how to do this. Any ideas?


2. How to start android emulator in a different port

I am  beginner in Android ,how to start  the emulator in a different
port using eclipse Run Configuration
Under 'Additional Emulator Command Line Options ' I tried with
different options and failed
emulator -port 5556
port 5556
emulator -5556
and so on ,but nothing worked out for me .I could appreciate if
someone points me with the right command


3. How to know the gateway address in PDP connection?

4. HP Android Samsung Langsung Melejit

5. Netbook Nokia Pakai Android?

6. getFromLocationName always throws IOException first time, but is successful second time with same input

7. How to Make your owrn SDK with full calss library(function)