henrytao-me / rx-shared-preferences

RxJava SharedPreferences for Android, lightweight and extendable
Apache License 2.0
29 stars 4 forks source link

observing preferences does not work after GC #10

Open piotrbazan opened 8 years ago

piotrbazan commented 8 years ago

BasePreference class registers listener:

mSharedPreferences.registerOnSharedPreferenceChangeListener((preferences, key) -> mSubject.onNext(key));

but according to the SharedPreferences doc:

This is confirmed in the runtime. A few first preference changes make actions trigger but after GC there are no actions invoked.

henrytao-me commented 8 years ago

Nice find. Thanks for your comment. I will look into it. Perhaps, I should use static or change the design a little bit.