private View mCurrentView;
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
mCurrentView = (View)object;
}
public View getPrimaryItem() {
return mCurrentView;
}
ViewPager的adapter通过setPrimaryItem方法设置当前显示子view.
将其保存下来可作后续应用。