I have some heavily crafted user interface elements inside tabs that take some time to create
If "some time" exceeds ~ 5 milliseconds, your application is broken and needs to be fixed. Use Traceview to pinpoint where you spend your time, and then repair issues so it takes less time for the main application stream.
What is the correct way to create fragments inside the tabs ONCE and avoid recreating their appearance when scrolling between other tabs?
AFAIK, the FragmentPagerAdapter should not have the effect you are describing (although the FragmentStatePagerAdapter will be). But, again, if you fix the onCreateView() performance onCreateView() , even the FragmentStatePagerAdapter will not post the issue.
source share