Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!