Home Ask Login Register

Developers Planet

Your answer is one click away!

ehsan ashtiani 2 weeks ago

don't let user swipe between fragments

I'm new in android development. I have some fragments which are displayed in Tab Layout. i don't want to let users swipe between Tabs. i want users stay in first Tab. then i set a button at the bottom of the first tab and when users click on the button, then they go to second tab(next fragment).like image attached below. how i can do this? Thank you....

Screenshot of my first tab


CommonsWare 2 weeks ago

Step #1: Do not use TabLayout.

Step #2: Do not use ViewPager.

Step #3: When the user clicks the button, do something to replace the contents of your initial UI with the next UI, such as executing a FragmentTransaction.

Post Status

Asked in 2 weeks ago
Viewed 3,198 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life