Android firebase recycler adapter填充null

时间:2016-12-06 04:27:40

标签: android firebase firebase-realtime-database firebaseui

如何确定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);

        }
    };

...谢谢

0 个答案:

没有答案