Skip to content

Commit 9610af6

Browse files
committed
Now the EditText _inputSearchText is not accessed anymore from a non-UI thread by the filter() operator: instead we use the text-change event.
This fixes #94
1 parent 9877c7f commit 9610af6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/com/morihacky/android/rxjava/fragments/DebounceSearchEmitterFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
7373

7474
_disposable = RxJavaInterop.toV2Observable(RxTextView.textChangeEvents(_inputSearchText))
7575
.debounce(400, TimeUnit.MILLISECONDS)// default Scheduler is Computation
76-
.filter(changes -> isNotNullOrEmpty(_inputSearchText.getText().toString()))
76+
.filter(changes -> isNotNullOrEmpty(changes.text().toString()))
7777
.observeOn(AndroidSchedulers.mainThread())
7878
.subscribeWith(_getSearchObserver());
7979
}

0 commit comments

Comments
 (0)