Prefser uses SharedPreferences.registerOnSharedPreferenceChangeListener() in Prefser.observePreferences(). As per the documentation of registerOnSharedPreferenceChangeListener():
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.
So the current implementation leads to the listener being GCed after some time which leads to changes not being propagated to observers any longer.
There already is a fix in the RxJava1.x branch. I'm currently migrating it to the RxJava2.x branch, PR incoming.
Prefser uses
SharedPreferences.registerOnSharedPreferenceChangeListener()
inPrefser.observePreferences()
. As per the documentation ofregisterOnSharedPreferenceChangeListener()
:So the current implementation leads to the listener being GCed after some time which leads to changes not being propagated to observers any longer.
There already is a fix in the RxJava1.x branch. I'm currently migrating it to the RxJava2.x branch, PR incoming.