我正在使用 RxBinding 来处理我的应用程序中的搜索。如何将结果作为项目列表获取?toList().toBlocking().single()
不是无限流中的选项,因为onComplete()
永远不会被调用。有任何想法吗?谢谢。
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 -> {});