Sunday, December 15, 2013

Re: [android-developers] why does not android.content.SharedPreferences#getAll() return an unmodifiable map ?

Laziness? :)

On Thursday, December 12, 2013 12:52:51 AM UTC+2, Mr&Mrs D wrote:


On Wednesday, December 11, 2013 8:30:53 PM UTC+2, Harri J. Smatt wrote:
I am quite sure this relates to the fact changing the values on a Map object, i.e on memory only, does not give too many options to store same values on SDcard more for later use.

So why it does not return an unmodifiable map ?  It is very cheap, getAll is not meant to be used in a loop anyway - what am I missing ?
H

On 10 Dec 2013, at 21:57, Palmer Eldritch <the....@gmail.com> wrote:

As per its docs :


Note that you must not modify the collection returned by this method, or alter any of its contents. The consistency of your stored data is not guaranteed if you do.
 
Is there a reason it does not return an unmodifiable map ?


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate