Create RecyclerView item layout based on content of data
I'm creating a recycler view of data objects, each of these object will vary, eg. Obj 1 - String Heading - String Desc - Image Obj 2 - String Desc Obj 3 - Image - String Link Obj 4 - String Desc - Video etc So I need to create my item layout dynamically to suit each data object. I don't want to create an item layout with all the possible views and components and show and hide as I feel it's bad practice. So my issue is I need to access an object from the list using the position in the onBindViewHolder in order to construct my layout in the ViewHolder class. I tried using a method which I