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

Jared Lewis
215 PointsIt doesn't say showfactTextView
The showTextView is in red
//Declare our view variables and assign the the Views from the layout file
TextView factLabel = findViewById(R.id.showfactTextView);
5 Answers

Gunjeet Hattar
14,483 PointsHi Jared,
Simply go to your layout.xml file where you design the layout and check if the id of the TextView under consideration is called showfactTextView , if it's in red then it doesn't probably match with the id in your xml file. Both should have the same name

Paolo Scamardella
24,828 PointsI'm not sure if Gunjeet Hatter answered the question, but do not forget to add the cast (TextView) before findViewById like: TextView factLabel = (TextView) findViewById(R,id,showfactTextView);

Gunjeet Hattar
14,483 PointsOh my bad! Glad you observed Paolo. Thanks. Yes Jared, you need to add a cast too.

Jared Lewis
215 PointsIt is still in red

Jared Lewis
215 Points@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stupidfactsftw);
//Declare our view variables and assign the the Views from the layout file
TextView factLabel = (TextView)findViewById(R.id.showfactTextView);
Button showFactButton;
The showfactTextView is in red

Gunjeet Hattar
14,483 PointsCan you paste the textView xml code from activity layout file here? Also did you try to clean the project?

Paolo Scamardella
24,828 PointsAlso, paste the error.

Jared Lewis
215 PointsThis is the error
Error:(21, 47) error: cannot find symbol variable factTextView