获取viewpager当前展现的fragment

1 使用独一无二的tag getSupportFragmentManager().findFragmentByTag("Some Tag"); MyFragment myFragment = MyFragment.newInstance(); mPageReferenceMap.put(index, "Some Tag"); getSupportFragmentManager().beginTransaction().add(myFragment, "Some Tag").commit(); int index = mViewPager.getCurrentItem(); String tag = mPageReferenceMap.get(index); Fragment myFragment = getSupportFragmentManager().findFragmentByTag(tag); 方案2  http://xhmj12.iteye.com/blog/1990760  http://blog.csdn.net/piglovesula/article/details/12916279
相关文章
相关标签/搜索