I have a Fragment (I\'ll call it pagerFragment) that is added to the backstack and is visible. It holds a viewPager with a FragmentPagerAdapt
I had same problem, just set adapter twice at once and that's all.
Example code :
private fun displayImg(photo1:String, photo2:String){ val pager:ViewPager = v?.findViewById(R.id.ProductImgPager)!! val arr = ArrayList() arr.add(photo1) arr.add(photo2) pager.adapter = AdapterImageView(fm, arr ,arr.size) pager.adapter = AdapterImageView(fm, arr ,arr.size) }