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 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,562 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,562 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.