Caution: The preference manager does
not currently store a strong reference to the listener. You must store a
strong reference to the listener, or it will be susceptible to garbage
collection. We recommend you keep a reference to the listener in the
instance data of an object that will exist as long as you need the
listener.
This is confirmed in the runtime. A few first preference changes make actions trigger but after GC there are no actions invoked.
BasePreference class registers listener:
but according to the SharedPreferences doc:
Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
This is confirmed in the runtime. A few first preference changes make actions trigger but after GC there are no actions invoked.