Android Build a Simple Android App Basic Android Programming Accessing Views in Code: Declaring Variables

TextVIEW in red.

I can't get the private statement out of red. I hit alt enter and get an auto generated implement the app indexing API.

AYDIN ÜNAL
AYDIN ÜNAL
5,638 Points

import android.widget.TextView; write directly this.

This will make the "TextView" become normal? Thank you for your reply.

private import.android.widget.TextView;

will this be correct?

2 Answers

AYDIN ÜNAL
AYDIN ÜNAL
5,638 Points

nope. there is a part like this "import..." open it by clicking + near it. then add this line : import android.widget.TextView;

Ok it's finally out of red. Will it have any other issues? Thank you for your help.

Luke Horvath
Luke Horvath
590 Points

Make sure you write it as 'TextView', not 'textview'