Replacing ViewPager with Fragment - Then Navigating Back
问题 I've got an activity which initially hosts a ViewPager, hooked up to a FragmentPagerAdapter. When the user clicks on an item inside the ViewPager's child fragment, I'm using a FragmentTransaction to replace an empty container view with a new Fragment which I want to navigate to. If I use addToBackStack() on the transaction, commit the transaction and then navigate back, I am not returned to the ViewPager's views (the initial layout). If I don't use addToBackStack() on the transaction, commit