Questions tagged [fragmentstateadapter]

35 questions
0
votes
0 answers

ViewPager2 and FragmentStateAdapter not updating on notifyDataSetChanged()

I followed this tutorial to create a Tab layout with ViewPager2 and FragmentStateAdapter. In my adapter I have an ArrayList with data for the fragments which I then pass differently according to the position of the fragment. I am passing the data…
Luke Galea
  • 179
  • 2
  • 15
0
votes
1 answer

ViewPager2: Can't select particular fragment programmatically

I'm trying to select particular fragment say, 2nd or 3rd fragment in ViewPager2 programmatically. It's not working properly. Sometimes it works, sometimes not. Although It's working for TabLayout every time. What I have tried: I have tried using…
0
votes
2 answers

Issue on implementing ViewPager2 with FragmentStateAdapter

I am from ViewPager with FragmentPagerAdapter which has a very straight forward implementation like this. public class FragmentAdapters extends FragmentPagerAdapter { private final List mFragmentList = new ArrayList<>(); private…
Mihae Kheel
  • 2,441
  • 3
  • 14
  • 38
0
votes
1 answer

How to know primary fragment item of FragmentStateAdapter

I have a view pager type FragmentStateAdapter and would like to know when the primary fragment is in position e.g. 100% visible. Does FragmentStateAdapter even support this? I've already tried approaches on this post with no luck. Each fragment in…
1 2
3