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 trialalex lewis
1,324 PointsToast Task 3
I can't figure out what to do. I've made a bunch of changes and it still tells me there is a syntax error.
Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH_LONG);
allDoneToast.show();
allDoneToast.makeText(this, "All Done!", Toast.LENGTH.LONG).show();
4 Answers
aaron joseph
1,294 PointsToast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH_LONG); allDoneToast.show(); Toast.makeText(this, "Yay! Our activity was created!", Toast.LENGTH_LONG).show();
this should work
alex lewis
1,324 PointsThis is my code:
Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH.LONG); allDoneToast.show(); Toast.makeText(this, "Yay! Our activity was created!", Toast.LENGTH_LONG).show();
and this is what it tells me is the problem:
JavaTester.java:67: error: cannot find symbol Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH.LONG); ^ symbol: variable LENGTH location: class Toast 1 error
alex lewis
1,324 Pointsso, i retyped it and it's exactly the same as what i put before and it works now.... not sure what happened.
alex lewis
1,324 Pointsin the last code i posted, length long should have an underscore, not a period.
aaron joseph
1,294 Pointsmake one of the answers a best answer