如何确定firebase回收器适配器是否返回null?
当用户搜索图书并返回null时,我有另一个操作。
FirebaseRecyclerAdapter<Books, BooksViewHolder> adapter = new FirebaseRecyclerAdapter<Books, BooksViewHolder>(
Books.class,
R.layout.book_page,
BooksViewHolder.class,
bookTitleRef.orderByChild("title").startAt(search_title).endAt(search_title + "\uf8ff")) {
@Override
protected void populateViewHolder(final BooksViewHolder booksViewHolder, final Books books, final int position) {
final String book_id = getRef(position).getKey().toString();
Log.i(TAG, "populateViewHolder: " + book_id);
}
};
...谢谢