Why is this recyclerview only shows 5 items?


So this recyclerview somehow only shows 5 items. When I delete the 5th item, the 6th item will comeout, so it seems it can only shows 5 items. Why?

For further information, this recyclerview is using Groupie library. I have used the same code in other activity but this one, each row is much bigger in terms of height because it has more information, does it have to do with the reason why the 6th item cannot be shown? The other recyclerview using groupie only shows name in each row, so it can show up to 7 items so far, only this one, despite using the same code, only shows 5 items maximum.

Following is the recyclerview code:

private fun fetchProducts() {

        databaseReferenceProducts = FirebaseDatabase.getInstance().getReference("produk")
        databaseReferenceProducts.child(uid).addListenerForSingleValueEvent(object: ValueEventListener {
            override fun onDataChange(snapshot: DataSnapshot) {
                if (snapshot.exists()) {
                    val adapter = GroupAdapter<GroupieViewHolder>()

                    snapshot.children.forEach {
                        val user = it.getValue(DataProduk::class.java)
                        if (user != null) {
                            binding.daftarProdukRecyclerView.adapter = adapter


            override fun onCancelled(snapshot: DatabaseError) {


For whoever facing this kind of issue, this is because the RecyclerView is overlapped with ScrollView. Replace it with NestedScrollView instead.

Answered By – Tommy –

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published