commit | de0c99e89bfe2df43e363f2521c55d5da166ddad | [log] [tgz] |
---|---|---|
author | Andrew Solovay <asolovay@google.com> | Mon May 12 19:50:37 2014 -0700 |
committer | Andrew Solovay <asolovay@google.com> | Mon May 19 16:05:06 2014 -0700 |
tree | c1521942f0e847d12ae24a558c82b1d0081156c3 | |
parent | 0e286ab1f0eaeb2bb75c7a76ff8f3d08267e7fc3 [diff] |
Noted that OnSharedPreferenceChangeListener does not store a strong reference to the listener. Because of this, the listener is susceptible to garbage collection unless the caller preserves a strong reference to it. We suggest that the caller store a reference to the listener in an instance field of an object that will exist as long as the listener is needed. Also fixed code sample formatting in Settings.jd (some lines were overlong). Docs are staged in: http://asolovay.mtv:8901/guide/topics/ui/settings.html#Listening http://asolovay.mtv:8901/reference/android/content/SharedPreferences.html#registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) Bug: 10437648 Change-Id: I48f5b87fa2ca7a240661d0cc00114d225819d54d