Where to restore fragment state that is inside ViewPager
Short Version: I have an Activity that has a ViewPager. The ViewPager has three fragments inside it. I am storing the data inside the fragments by implementing Parcelable and storing it inside the bundle. Now the question is where do I restore the data. I am confused because (from what I know) the ViewPager is creating a new instance of the fragment each time I rotate the screen. (A new activity is created -> new ViewPager -> new Fragment). Please do correct me if I am wrong. Long version: My ViewPager inside MainActivity ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);