As far as I understand the following code from DebounceSearchEmitterFragment.java#L76:
_disposable = RxJavaInterop.toV2Observable(RxTextView.textChangeEvents(_inputSearchText))
.debounce(400, TimeUnit.MILLISECONDS)// default Scheduler is Computation
.filter(changes -> isNotNullOrEmpty(_inputSearchText.getText().toString()))
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(_getSearchObserver());
filter() accesses the GUI element _inputSearchText, which it must not do: see StackOverflow: Is it okay to read data from UI elements in another thread?
Instead the text should be read from the change-event like this:
.filter(changes -> isNotNullOrEmpty(changes.text().toString()))
As far as I understand the following code from DebounceSearchEmitterFragment.java#L76:
filter()accesses the GUI element_inputSearchText, which it must not do: see StackOverflow: Is it okay to read data from UI elements in another thread?Instead the text should be read from the change-event like this:
.filter(changes -> isNotNullOrEmpty(changes.text().toString()))