3 android fragments in viewpager, how to keep them all alive?

use

setOffscreenPageLimit(int limit) 

on the ViewPager object.

From the documentation:

[It set]s the number of pages that should be retained to either side of the current page in the view hierarchy in an idle state.

Leave a Comment