If I use viewpager in wrap content I always end up with the error
Process: com.example.openinapp, PID: 5144
java.lang.IllegalStateException: Pages must fill the whole ViewPager2 (use match_parent)
//line added
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
return MyViewHolder(view)
}