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 Testing and Debugging Toast Notifications

João Albuquerque
João Albuquerque
1,642 Points

Android Studio is telling me it cannot resolve method (?)

I put:

Toast.makeText(FunFactsActivity.this, "Yay!", Toast.LENGTH_SHORT).show();

and Android Studio is telling "Cannot resolve method 'makeText(com.gabas.funfacts.FunFactsActivity, java.lang.String, int)'

the code is with a red line below.

Daniel Bowen
Daniel Bowen
8,127 Points

If you still haven't figured this out, I'd be willing to take a look. Just post the relevant class with ``` before and after the code to format it into a code block.

2 Answers

João Albuquerque
João Albuquerque
1,642 Points

I gave up to solve this problem and when I opened the studio android today, Toast worked usual haha

Daniel Bowen
Daniel Bowen
8,127 Points

You might have just needed to clean project then, first thing I always do with errors that aren't readily apparent. Glad you got it figured out though.