獲取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
相關文章
相關標籤/搜索