I am trying to have 2 layout in one RecyclerView
I have a recycler view list which is called Bookmark and it is parsed from an xml and this is all working , but I wa
You can use different layouts on the same RecyclerView , just override adapter getItemViewType
() method and return a different int value for the button layout, in your example you should return for example 1 for the normal item and 2 for the button item.
The view type is passed as argument to onCreateViewHolder()
method and depending of the viewType value you inflate the normal layout or the button layout.
It seems that you need also make getItemCount()
to return one more than the array size
Hope it will help
Here an example: How to create RecyclerView with multiple view type?