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

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.