Problem: I have a ViewPager setting with a FragmentStatePagerAdapter that uses a global arraylist to contents its fragments. When I want to update this global array, I simply call the arraylist.add() method, create an instance of the new FragmentStatePagerAdapter and the new ViewPager. However, for some reason, the adapter does not call getItem. Not that this dataset is empty (it isnβt) or something else ... it just doesn't get called. I even installed a log to check it out. Here is my code:
Are there any problems with this setting? I can verify that the global arraylist has data inside it, but no fragment is created to reflect this.
source share