I have an application with three tabs.
Each tab has its own layout .xml file. The main.xml has its own map fragment. It\'s the one that shows up when the application
I respect all the answers but i found this one liner solution: If n Is the Number of tabs then:
mViewPager.setOffscreenPageLimit(n);
Example: In case mentioned :
mViewPager.setOffscreenPageLimit(2);
View pager implements a queue so, you don't have to let it remove that fragment. onCreateView is called only once.