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 Simple Android App (2014) Testing and Debugging Making a Toast

I have not been able to complete the code challenge. The first one on stage 6. Can anyone help?

I passed the first 2 tasks but not the 3rd

3 Answers

Stone Preston
Stone Preston
42,016 Points

you just need to chain a call to the makeText method of the Toast class and the show method:

Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH_LONG);
allDoneToast.show();
//this combines the lines above into one. 
//since you are doing it all at once, 
//you dont need to store the toast in a variable
Toast.makeText(this, "Second", Toast.LENGTH_LONG).show();

I did all of that, but it still said it was wrong...

Stone Preston
Stone Preston
42,016 Points

post the code you wroite from the challenge

I figured it out. I was missing a comma... very critical.