In the Android docs, there is a FragmentStatePageAdapter
that instantiates a Fragment
every time getItem
fires. Is this sane? I've checked, and this fires every time I swipe, which means it creates a Fragment
every time? Is this correct?
@Override
public Fragment getItem(int i) {
Fragment fragment = new DemoObjectFragment();
Bundle args = new Bundle();
// Our object is just an integer :-P
args.putInt(DemoObjectFragment.ARG_OBJECT, i + 1);
fragment.setArguments(args);
return fragment;
}
I'm pretty new to Android, so I just wanted a sanity check on this. It doesn't sound right.