Florian Monfort Florian Monfort - 6 months ago 12
Android Question

AS does not find symbol, even after importing TextView

I am learning how to do Android development right now and arrived at this tutorial on Google's website:

https://developer.android.com/training/basics/firstapp/starting-activity.html

However after following the instructions - I'm assuming I missed something - here is what I get in AS:

enter image description here

And so Gradle will not compile it.

Answer

you should create an xml and declare things in it .in resource->lay out folder for using this things in java in

<TextView
      android:id="@+id/t_id"
      android:layout_width="300dp"
      android:layout_height="200dp"
      />

and in java class file

TextView txtView = (TextView) findViewById(R.id.t_id);

and you should declare and use the text view inside oncreate function