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

What does this mean?

Initialize the showFactButton variable using the findViewById() method like the TextView above it. The ID for the button is showFactButton, and don't forget to cast it to a Button with (Button)!

This is what I put in and I can't figure it out! TextView factLabel = (TextView) findViewById(R.id.factTextView); Button showFactButton= findViewById(R.id.showFactButton);

1 Answer

Hi Travis, it looks like you forgot to cast to a button as stated in the problem:

Button showFactButton= (Button)findViewById(R.id.showFactButton);

I am so close yet so far it seems! Thanks!