Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAustin Garrison
9,692 PointsIF statement when a certain page is selected.
I'm trying to figure out how an if statement can tell what page the user is on. I want the current page to take the user to the same next page regardless which button pressed, but change the next page text depended on which button pressed.
itemSelected = ExampleTwo + " was picked.",
choice1Button.setOnClickListener((v) { if(page[0] && choice1) { itemSelected = ExampleOne + " was picked." } });
pages[0] = new Page(BlahBlah, new Choice(ExampleOne, 1), new Choice(ExampleTwo, 1));
pages[1] = new Page(itemSelected, new Choice(BlahBlah, 2), new Choice(BlahBlah 3));
What would replace where i put page[0] in the if statement