If your pager is inside a Fragment then use this:
private fun getPagerCurrentFragment(): Fragment? {
return childFragmentManager.findFragmentByTag("android:switcher:${R.id.myViewPagerId}:${myViewPager.currentItem}")
}
Where R.id.myViewPagerId
is the id of your ViewPager inside the xml Layout.