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 (2014) Basic Android Programming Accessing Views in Code

cant find resource name

in this TextView factLabel = (TextView) findViewById(R.id.factTextView);

after R.id. in my android studio it not showing "faceTextView" when i enter manually error come say create id for this

Ratul Sarna
Ratul Sarna
Courses Plus Student 11,618 Points

We would need to see more of your code. Could you please copy and paste your onCreate() method as well as the layout xml file for the activity?

2 Answers

In this line you are referring to factTextView

TextView factLabel = (TextView) findViewById(R.id.factTextView);

However in your concluding statement you are looking for faceTextView. Which one is it?

Make sure you spelt the TextView correctly in the layout xml file.

Hope this helps

Matthew Stanciu
Matthew Stanciu
4,222 Points

Mine still isn't working. I don't know what I'm doing wrong.

 // Declare our View variables and assign them the Views from the layout file
TextView factLabel = (TextView) findViewById(R.id.factTextView);
Button showFactButton;

My mistake now everything working gr8 thankx :)