EGHDK
EGHDK

Reputation: 18120

ViewPager or Fragments?

I need to make an application that will basically be a 5 "page" quiz with true and false buttons. I don't think that a new layout/activity is needed for each "page". That would be overkill. Would a fragment or ViewPager be appropriate? Does it break any Android Guidelines? They both seem to make sense to me. Maybe fragments a little more because of a tablet/alternate layout. Any ideas would be appreciated.

Upvotes: 1

Views: 259

Answers (3)

Anonymous
Anonymous

Reputation: 23

According to your flow u can use the this also In same activity you can change the question just on click of button.

And if you want user to revisit all question u can use view pager.

Upvotes: 0

cbrulak
cbrulak

Reputation: 15629

I've been using the ViewPager in one of my projects, for side swiping between similar yet distinctly different views.

It is working very well.

It depends on your flow. View Pager will work well if your users can randomly go through the views. If you want things to be in a specific order then ViewPager probably won't work.

Upvotes: 1

Bucks
Bucks

Reputation: 687

you can achieved by creating 5 pages dynamically and load that in single layout/activity

By using dynamically load pages helps In future you want to add 2 pages of question its easy to do

Upvotes: 0

Related Questions