I have multiple fragments in an activity. How do i load the next fragment when i slide from right to left? I have made the fragment classes and also designed their layouts. I have a main activity from which after login the user reaches next activity. This activity has multiple fragments. The first fragment is launched automatically but next fragments will be launched when user slides the screen from right to left.
Asked
Active
Viewed 58 times
-2
-
4Possible duplicate of [How to implement a ViewPager with different Fragments / Layouts](http://stackoverflow.com/questions/18413309/how-to-implement-a-viewpager-with-different-fragments-layouts) – SaravInfern Jul 11 '16 at 08:37
-
Duplicate. But if you awnt to dinamycally create new fragments, override the adapters getItem and getcount. Make sure to keep references of each. – VikingPingvin Jul 11 '16 at 08:41
1 Answers
0
You can use ViewPager
to display fragments on swipe.
For Reference How to implement a ViewPager with different Fragments / Layouts