This is not duplicate of How to create RecyclerView with multiple view type? There are question on SO for different views for different row in same list but this is not the same.
This is a very simple question as I am a beginner to android development and OOP as well.
I have multiple(three) tabs in my android app and each tab has a list of items inside it (like in whatsapp).
I have successfully created a list(not listView) using recyclerView
in one of the tabs. Now I want to create another list under the second tab but I have to use the previously used adapter. I don't know how to use onCreateViewHolder()
to return multiple holders.
I tried if(object instanceOf class)
inside getItemViewType()
but I dont know how to access the object
for comparison.