Yuri
private val keyChangesObservable: Observable<String> init { keyChangesObservable = io.reactivex.Observable.create(ObservableOnSubscribe<String> { emitter -> val listener = SharedPreferences.OnSharedPreferenceChangeListener { _, key -> emitter.onNext(key) } emitter.setCancellable { prefs.unregisterOnSharedPreferenceChangeListener(listener) } prefs.registerOnSharedPreferenceChangeListener(listener) }).share() }
gildor
louiscad
Eugen Martynov
A modern programming language that makes developers happier.