FragmentStatePagerAdapter
is deprecated from API 27. What's the alternative of FragmentStatePagerAdapter
?
private class MainPagerAdapter extends FragmentStatePagerAdapter {
MainPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
Fragment result = new DummyFragment();
return result;
}
@Override
public int getCount() {
return 5;
}
}
Above code shows FragmentStatePagerAdapter
, getItem(...)
and super(...)
as deprecated.