I have read from @antonyt\'s answer to this StackOverflow question that FragmentPagerAdapter
will try to reuse an existing fragment found by
All fragments which not set setRetainInstance(true)
are destroyed on orientation change. After orientation changed all fragments are recreated and reattach by fragment manager (so fragment goes throught entire lifecycle).
All fragment attached by ViewPager
are added to fragment manager with special tag. ViewPager
try to reuse fragment recreated after orientation changed (by searching for tag in fragment manager). If such fragment don't exist then FragmentPagerAdapter.getItem(int)
is called to create new fragment.