Skip to content Skip to sidebar Skip to footer

Updating Offscreen Fragments In A Viewpager

I have an application that has three fragments: Records, Chart, and PieChart. These fragments are stored in a ViewPager in a single activity and the user can swipe between them.

Solution 1:

Going by the example from here:

http://developer.android.com/reference/android/app/Fragment.html

You should save all your data that's backing each of your UI components in the Bundle of your onSaveInstance() of your Fragment. Then in the onActivityCreated() callback, restore the data.

Post a Comment for "Updating Offscreen Fragments In A Viewpager"