I have a ViewPager, and I\'d like to get the current selected and visible view, not a position.
getChildAt(getCurrentItem) returns wrong Vi
You can find fragment by system tag. It's work for me. I used it in OnMeasure function.
id - viewPager ID
position - fragment which you want to get
Important! You get this fragment if your fragment was created in adapter. So you must to check supportedFragmentManager.findFragmentByTag("android:switcher:" + id + ":" + position) nullify
You can get view like this:
supportedFragmentManager.findFragmentByTag("android:switcher:" + id + ":" + position).view
You shouldn't give custom tag in adapter