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

Ema Johnston
Ema Johnston
1,917 Points

Hi, When enter the Toast activity to FunFacts activity I get red squiggly lines?

Build a simple app with Java. Debugging

Toast.makeText( context: this, text: "Yay! our activity was created", Toast.LENGTH_SHORT).show();

I get red squiggly lines under 'context:','text:','show'?

The error is that it cannot "resolve them". I picked on each word to alt, enter but I'm not sure what to choose.

2 Answers

Jamen Huang
Jamen Huang
7,651 Points

may be try something like --- Toast.makeText( context: funFactsActivity.this, text: "Yay! our activity was created", Toast.LENGTH_SHORT).show();

Ema Johnston
Ema Johnston
1,917 Points

Sorted! I should have chosen the option to type Toast. (then choose the autocomplete from the drop-down menu "Create new Toast." I had typed this in manually which it didn't like at all.

Ema Johnston
Ema Johnston
1,917 Points

Hi Jamen, Thank you for your reply. Yes, this seems to work too. However, it still has the same error messages. I'll have another wee fiddle with it :-)