I want to make a registration form for my application . I want to ask a few question in each step. I want to have 3 steps and users should move to next step upon completion of previous step.
How can I do something like this in android in one activity?
You can use a combination of Fragments
and ViewPager
to accomplish your task!
Recommended ViewPager Tutorials :
Hope this helps!
You can use fragments. You can make each your step a fragment and when user answers your questions you can jump to next step.(fragment)
You can check fragments from here: http://developer.android.com/guide/components/fragments.html
If your steps are independent from each other you can put your fragments in a viewpager and make your steps slidable.
Here is a popular view pager library with indicator. (You can use indicators to notice current step) https://github.com/JakeWharton/Android-ViewPagerIndicator
Good luck.
Check my below answer and Use this awesome solution using latest ConstaintLayout
released. I have made checkout process in horizontal steps with progressbar.
https://stackoverflow.com/a/42694364/4862126
I have made this without using any library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With