Complement:
    I've tried again and find that if using addPreferencesFromResource
() and then the return is likely the same no matter using
getDefaultSharedPreferences() or getSharedPreferences(), and I
referred to source codes of these two methods, found that they have
almost same functionality if the Context is the same, but I used
different activity and got the same return, why?

On 2月15日, 下午12时43分, robert <[email protected]> wrote:
> Hi All:
>       When I use PreferenceManager.setDefaultValues() in my main
> activity, and then use getDefaultSharedPreferences(), the returned
> SharedPreferences has nothing in it(getAll().size == 0).
> And when I use addPreferencesFromResource() in my own
> PreferenceActivity, SharedPreferences has
> the added  preference. So I'm puzzled that if there is any need to use
> addPreferencesFromResource(default)
> to add default preference layout in main activity, and if yes, is
> there any difference between the default preference
> and the normal preference? And is it true that
> getDefaultSharedPreferences() is related to addPreferencesFromResource
> (or other add preferences methods)? If any suggestion, please reply,
> thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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