你好,我在使用whereEqualTo获取可能值列表时遇到问题
我的目标是做这样的事情
query
.orderBy("dateTime", Query.Direction.DESCENDING)
.limit(LOAD_COUNT)
.whereEqualTo("tittle","new advert for search2")
.whereEqualTo("tittle","new advert for search1")
.get()
或
query
.orderBy("dateTime", Query.Direction.DESCENDING)
.limit(LOAD_COUNT)
.whereEqualTo("tittle","new advert for search2" || "new advert for search1")
.get()
结构: enter image description here 屏幕截图 enter image description here 与日期时间 enter image description here
或将几个查询合并为一个,以得到一个包含结果的列表
但是我找不到解决此问题的任何方法
我希望有人知道解决此问题的最佳方法
答案 0 :(得分:0)
我使用此适配器做了类似的事情:RecyclerViewMergedAdapter
定义2个不同的查询并将其设置为2个不同的适配器(在下面的示例中,其为mAdapter
和mAdapter2
)。然后以这种方式合并适配器:
RecyclerViewMergeAdapter recyclerViewMergeAdapter = new RecyclerViewMergeAdapter();
mOrdersRecycler.setAdapter(recyclerViewMergeAdapter);
recyclerViewMergeAdapter.addAdapter(mAdapter);
recyclerViewMergeAdapter.addAdapter(mAdapter2);
//set recyclerview adapter to newly mergeadapter
mOrdersRecycler.setAdapter(recyclerViewMergeAdapter);