0

I have a couple of fragments being held inside a ViewPager contained in an fragment. How do I go about implementing the "Up Button" in this situation? I've been unsuccessful since I can't even make the Up button functionality appear on the screen.

The structure is the following:

Activity_One hosts a FragmentWithViewPager with two fragments in it (Fragment_One and Fragment_Two). I need to press an Up button to remove the FragmentWithViewPager and its contained fragments so that the user can go to whatever is in the backstack.

I hope this is clear. Any detailed information on what methods I should implement and at what location would be greatly appreciated.

CBA110
  • 1,072
  • 2
  • 18
  • 37
  • `ViewPager` is attached to activity, so it acts as one thing, when you press back button, it means you are closing an Activity, not ViewPager, its attached and one thing. instead, you can use one activity with button, which could open this activity_one and when you will press back button, it will show you the activity with button to get on to viewpager. – Ajay P. Prajapati Mar 23 '16 at 16:14
  • Hi @AjayP.Prajapati. Thanks for the feedback. The ViewPager is inside a fragment (FragmentWithViewPager) which is attached to the activity. I hope that's clear. – CBA110 Mar 23 '16 at 16:19

0 Answers0