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

Danny Malaeb
Danny Malaeb
2,459 Points

Is there an issue with my Android studio?

I type 'TextView' and 'Button' but it appears in red. If I hover my mouse over it receive an error "Cannot resolve symbol 'button'".

This is what I have so far...

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fun_facts);

        // Declare our View variables
        TextView factLabel = findViewById();
        Button showFactButton;
    }

I know it shouldn't have an error because in the tutorial it doesn't appear as an error.

2 Answers

Hi Danny,

I had the same problem. Just click in the red writing and hit "Alt + Enter", and "Enter" again and it should import the correct folder automatically and the red should go away.

If you have any questions or problem, shoot right back.

No problem, glad I could help.