Monday, January 31, 2011

Re: [android-developers] Re: Handle preferences in BroadcastReceiver's

31.01.2011 15:53, Danny S. пишет:
> This matches the default preferences file and so I am able to read all
> pref values. But is this a "clean" way? Should I do better or create a
> separat preferences file using edit() method of SharedPreferences? Do
> you think my current procedure is bad and why?

Danny,

You can call PreferenceManager.getDefaultSharedPreferences to get the
prefs used by PreferenceActivity.

Relying on platform implementation details (appending package name,
etc.) only works until those implementation details change, and since
the filename for default preferences is not documented (AFAIK), that can
be anything between "never" and "any time"...

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate