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 trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Error Messages with Dialogs

Can't get passed through task 3 of 5

I seem to not get this part...

Have been trying somethings, but nothing makes sense any more :( plz help me

if (mUserInput.isCorrect()) { AlertDialog.Builder builder = new AlertDialog.Builder(GuessNumberActivity.this); AlertDialog dialog = builder.create(); dialog.show(); }

is what I've got...

4 Answers

Ben Jakuben
Ben Jakuben
Treehouse Teacher

The isCorrect variable is in the code that's already there for you, so you just need to check that. :)

boolean isCorrect = GuessEngine.testGuess(mUserInput);

Steve Cracknell
Steve Cracknell
Courses Plus Student 88,140 Points

Hi Ann,

This part of the code challenge is saying to add an if statement to check if the boolean variable isCorrect is true.

I had something similar to your code which didn't work, and after a quick google search I found some code that helped pass this task.

boolean condition = true; if(condition==true) { // Execute this code only if condition variable is true }

Steve Bedard
Steve Bedard
14,335 Points

You can just check

if(isCorrect) or if(isCorrect == true)

it basically mean: check if the boolean named isCorrect is true

Okay thx for the help!