Fragment Transaction In a RecyclerView

107 Views Asked by At

I have been building an social media app recently and faced a strange problem. I have a RecyclerView with items like this :

enter image description here

Here the gray part is A FrameLayout.The Problem is about that FrameLayout actually. The problem is that when I try to transact a childFragment to it it only transacts into the first item and other items in recyclerview is left empty. the adapter is like this

enter image description here

To make the things clear, when I submit a list like (ContentType.Video,ContentType.Gallery,ContentType.Image) it shows only ImageContent fragment inside of the first item of the RecyclerView. In my opinion this is something about the "id" part but I did not manage to solve this problem. Does anyone have a solition for this ?

0

There are 0 best solutions below