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

Benjamin Gooch
Benjamin Gooch
20,367 Points

Can't pass Challenge 1 out of 3 on ToastTest

Here's my exact code:

Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGHT_LONG).show();

I get a compiler error that says it doesn't recognize the symbol and points to the "." in "Toast.LENGTH_LONG".

Any idea?

This is what the compiler says:

JavaTester.java:75: error: cannot find symbol
      Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGHT_LONG);
                                                                  ^
  symbol:   variable LENGHT_LONG
  location: class Toast
1 error

2 Answers

Seth Kroger
Seth Kroger
56,412 Points

If you'll double-check what you typed, you'll see you misspelled LENGTH.

(Also, you don't need .show() yet. That's for the next step.)

Benjamin Gooch
Benjamin Gooch
20,367 Points

Thanks Seth, I looked over the spelling like 50 times and still missed it! Fresh eyes are a huge help. I've written something I couldn't figure out why it wouldn't work and spent hours checking over it. Then I'd take a 20 minute break and look at it again and see the issue immediately. And it's usually a single missed character.

Thanks again!