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 trialGeorge Brandt
Python Development Techdegree Graduate 9,649 PointsThe first page of the app is being set to the final page. It has only the PLAY AGAIN button.
if (page.isFinalPage()){ choice1Button.setVisibility(View.INVISIBLE); choice2Button.setText(R.string.play_again_button_text); } else {
choice1Button.setText(page.getChoice1().getTextId());
choice1Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int nextPage = page.getChoice1().getNextPage();
loadPage(nextPage);
}
});
choice2Button.setText(page.getChoice2().getTextId());
choice2Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int nextPage = page.getChoice2().getNextPage();
loadPage(nextPage);
}
});
}
Do not know why it is executing the if block on the first page (after the user enters their name)
1 Answer
George Brandt
Python Development Techdegree Graduate 9,649 PointsI believe I have solved my issue