Open
Description
BasePreference class registers listener:
mSharedPreferences.registerOnSharedPreferenceChangeListener((preferences, key) -> mSubject.onNext(key));
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity