use of multiple fragments inside a fragment in android

619 views Asked by At

I have a requirement in my application. my application has 6 fragments in a Navigation drawer each fragment represents single item in navigation drawer list.

But in one of the fragment i need to implement a form which will be spread across 5 views one at a time, can any one suggest me how to approach this in android.

Initially i thought of doing this using ViewPager , but i dont need horizontal swiping but need to go to next screen when clicked on a button.

Kindly advice me how to approach this.

Thanks & Regards.

Nagendra

1

There are 1 answers

0
Marvs On

You can create main fragment and sub-fragments. Inside the main fragment, show the sub-fragments by replacing them, store the data by creating an entity object here and pass it to the sub-fragments. Inside sub-fragments, pass the data to the main fragment entity using listeners.