Interesting, I noticed this line in the documentation just now, from
http://code.google.com/android/reference/android/content/SharedPreferences.html

"Note: currently this class does not support use across multiple
processes. This will be added later."

So to me, this means that even though my application's activities run
in one process, somehow the users experiencing this data loss problem
may be seeing it because they have a separate process accessing the
SharedPreferences before the first process has committed them to
storage?  This does not seem like the intended functionality of
SharedPreferences.

I'll buy that any changes before you call
SharedPreferences.Editor.commit() won't be seen by other processes,
but if process A commits, then process B loads them, shouldn't B see
A's commited information?  Or is the functionality to be added is what
will make this scenario work correctly?  For me, A and B are instances
of the same application.

If this scenario doesn't work: A commits, and then B loads but doesn't
see A's changes until some undetermined time later, then I can't use
SharedPreferences either.  Also, neither can anyone else for that
matter, because you'll never know if your information is in a usable
state.




On Nov 19, 11:55 am, Eric B <[EMAIL PROTECTED]> wrote:
> What I'm taking from this is that if my BroadcastReceiver, which runs
> off an AlarmManager, is accessing the preferences and the user then
> opens the PreferenceActivity in a separate process the behavior is
> undefined and most likely causes the PreferenceActivity to not "find"
> the existing values?
>
> I guess I'll have to switch to a database implementation then.
> SharedPreferences don't seem very robust, I'm not sure I can ever use
> them again, which is really sad since they are quite easy to use.
>
> Thanks,
> Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to