I have an app with a ViewPager
and three Fragment
s. I'm trying to figure out how to get the current Fragment
being viewed so I can get at its arguments.
I have an OnPageChangeListener
grabbing the current page index, but
ViewPager.getChildAt(int position);
returns a View
. What's the relationship between this View
and the current Fragment
?
I finally found an answer that worked for me. Basically, you can access the fragment for a viewPager page by using the tag "android:switcher:"+R.id.viewpager+":0".