Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 :)