Android RecycleView does not show data in list

后端 未结 1 1106
南方客
南方客 2021-01-29 15:14
 this.books = new ArrayList<>();
            mFirebaseDatabaseReference.child(SellBooksPost).addValueEventListener(new ValueEventListener() {
                @Over         


        
相关标签:
1条回答
  • 2021-01-29 15:37

    It's hard to say if this is a problem, but I do not see a call to RecyclerView.Adapter#notifyDataSetChanged() method after updating the data. So try call

    salesBookAdapter.notifyDataSetChanged()
    

    after

    books.add(new Book(
         AmessageSnapshot.child("SellBooksPostId").getValue().toString(),
         AmessageSnapshot.child("bookTitle").getValue().toString()
    ));
    
    0 讨论(0)
提交回复
热议问题