Obsolete
Status Update
Comments
dp...@gmail.com <dp...@gmail.com> #2
I would like to get the feature and its not a bug mistakenly added in the bug category...!
ha...@opentechinstitute.org <ha...@opentechinstitute.org> #4
Thanks for your suggestion! We are currently evaluating this request, but do not have any plans to implement it at the moment. Please star to add your vote and receive further updates, and feel free to add any comments to discuss your use case.
en...@google.com <en...@google.com>
mi...@gmail.com <mi...@gmail.com> #5
I have same problem
Description
SharedPreferences sp = this.getSharedPreferences("LocalCache", MODE_PRIVATE);
Set<String> items = sp.getStringSet("Items", new HashSet<String>());
items.add("#" + items.size() + ":This item can be saved to file?" );
SharedPreferences.Editor editor = sp.edit();
editor.putStringSet("Items", items);
editor.commit();
The expected result should be that another one item with different # was written to the file every time when the codes were executed.
The key cause should be I just modified the Set<String> object:items,which was got from SharedPreferences, and putted it back. And SharedPreferencesImpl only compares object reference to determine whether to save to file or not, the codes of line#413 in SharedPreferencesImpl.java is as following
if (existingValue != null && existingValue.equals(v)) { continue;}