现在有若干的页面
每个页面有按钮
按钮会跳转到别的窗体
每次返回的时候都会跳到PagerAdapter的第一个页面
现在想要回到跳转时的页面
有什么办法呢
public Object instantiateItem(ViewGroup collection, int position) {
int layoutId = 0;
if (position == 0) {
layoutId = R.layout.activity_main_menu1;
} else {
layoutId = R.layout.activity_main_menu2;
}
LayoutInflater inflater = LayoutInflater.from(m_Context);
ViewGroup layout = (ViewGroup) inflater.inflate(layoutId, collection, false);
collection.addView(layout);
if (position == 0) {
SetupPageIcons1(layout);
} else {
SetupPageIcons2(layout);
}
return layout;
}
https://www.cnblogs.com/AllenWen/p/4080296.html position就是页码