I'm using RxBinding to handle search in my app. How to get the result as a List of the items? toList().toBlocking().single()
is not an option inside infinite stream because onComplete()
will never be called. Any ideas? Thanks.
RxSearchView.queryTextChanges(searchView)
.filter(queryString -> queryString.length() > 3 || queryString.length() == 0)
.debounce(500, TimeUnit.MILLISECONDS)
.map(CharSequence::toString)
.flatMap(s -> Observable.from(fishPlaces)
.filter(fishPlace -> fishPlace.getName().toLowerCase().contains(s.toLowerCase())))
.subscribe(fishPlace -> { **// HOW TO GET A LIST<FISHPLACE> HERE???** }, throwable -> {});