I have a viewpager and a pagerAdapter which inflates a custom view and adds it to the collection. After setting up the viewpager and pageradapter, I proceed to get some data which I now want to display in one of the custom views. However I observed that the pagerAdapter.instantiateItem is not being called by that time. How can I get the viewpager to start instantiateItem right away?
Asked
Active
Viewed 4,112 times
3
-
`instantiateItem` of PagerAdapter is called every time fragment is accessed or created from ViewPager. If fragment is not created at this moment, `getItem` will get called. – Tixeon Oct 12 '17 at 04:04
1 Answers
2
instantiateItem
is called when the viewPager
calls the getItem
method. When the viewPager
is first displayed, getItem
is called for the currently displayed tab and the following tab.
Could you provide a code snippet for further details ?

theboldbaldguy
- 101
- 4