Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Component used: 'viewpager2'; Version used: '1.0.0' and '1.1.0-alpha01'; Devices/Android versions reproduced on: Android 10.0 and Android 11.0 emulators
Calling the Modifiable fragment collections section in the Migrate from ViewPager to ViewPager2 page seems to imply that the UI should be updated, as follows:
FragmentStateAdapter.notifyDataSetChanged()
method on aFragmentStateAdapter
which is associated to aViewPager2
does not result in theViewPager2
recreating itsFragment
s. TheI have created a minimal application here which demonstrates the problem. The ViewPagerAdapter ) is absolutely minimal such that only the MainActivity.onCreate(savedInstanceState:) method for the place where the MainActivity.onOptionsItemSelected(item:) method for the place where
FragmentStateAdapter
implementation in this application (i.e.createFragment(position:)
andgetItemCount()
methods are overridden. See theFragmentStateAdapter
is associated to theViewPager2
and see theFragmentStateAdapter.notifyDataSetChanged()
is called.