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

Benjamin Gooch
Benjamin Gooch
20,366 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,406 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,366 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!