Everyone.
So in this tutorial I'm going to actually create an object.
OK.
So let's actually first let's go to the activity.
Let's go to the content underlayment and examine here.
So let me show you the Android view at the top menu.
Just click on View and install windows and then click on project if you want to you can actually use
this shortcut here for Mac users.
You can actually hold down the command key on your keyboard down and then press on the number one key
on your keyboard.
And if you are using a Windows machine the shortcut is different.
It should be actually a control just hold under control on your keyboard down and the person number
one on the keyboard.
So just click on it.
Now here it is.
Our Android view.
Right.
It is not Android view.
Here you can see these two little triangles.
If you click on it you can actually see the left and right.
So now here let's open the rest for their.
Well there we have this folder open the layout folder and double click on this content underlayment
and examined.
So now let me double tap here in order to make this area wider so let's actually select this text here.
So now let's pro-white an ID for this text.
So what I am actually providing an ID for the state's view because I've want to interact with this text
view from my Java coats.
So here for the ID just step in here takes the one and then person enter on your keyboard.
Right.
So now you may ask what is this.
This view here is actually called the blueprint.
Right.
So here look at this bar here.
Here we have some options.
The first one here it says let me hover over this and it says show design.
If you just click on this one here now you can see that the blueprint is actually disappear.
Let's look at the second icon it says show blue print.
If I click on it now you can see that only we have the blue print here.
So I'll talk more about blue print later for not.
You can just see that how we can actually appear or disappear the blue paint or a design.
And let's actually look at the first icon.
If I click on it it says Now we can show the design plus blueprint.
Right.
So if you want to you can just click on this short and so that you can actually only see this design
here.
So the idea of these things is take Steven.
Now let's go to the main activity class here.
And it's actually for example create an object of a text.
So here I can see text view.
OK.
So first I referred to the name of this class text view and now I can't see th Steven.
So this is the name of the variable that you want to create here.
Assignment operator now able to actually be fair to the user interface objects that we have in say the
contents underlying minute exempt.
So here first of all I can say find view by ID so you can actually find out if you buy a specific ID.
So that's why we actually provided an ID for that actually for the text.
So I hear I hear see or or is a class that actually holds the ideas that we actually provide for their
user interface components inside our layout.
So our thought Id dot the one so you can see now I can only to this takes the one Id semicolon.
So now as you can see if you have an error it says there is an error and it says incompatible type.
It is required Android that widget that takes view found and read that view that view.
So it says that the variable that we have created here is actually of tapes view and now here we are
saying find view by id it can actually find an object of type view not a text view.
So I talked more about this later but text view let me tell you that takes is a subclass of view.
Our view is the superclass of taste.
So here we need to cast this takes view object the user interface component to a text view object in
order to actually let the Android know that we are a hundred and fifty percent sure that this user interface
components that we are referring to is of type takes view.
So we need to actually be 100 percent sure and we need to let the Android know that we are actually
sure that it is a test view if it is not of this view.
Let me try to show you the lay out content underlayment an example.
Here we have it takes you right.
The idea is this is the one if this is not actually a tissue for example if this is a button and here
let's go to the main activity class and here we say that this is actually a text view.
Our application is going to crash because we have a button inside our lay out.
And here we are saying that we have a takes.
If I actually just for example it to a text so I must be sure that this user interface component is
takes view and then I can go to this man with the class.
So here I cant just put a pair of parentheses.
So this is called casting.
OK.
So you know you will learn more about Castanea in Dover later for an hour to 40 and just put a pair
of Prentice's here and just type in here takes you be capital-T and then select this one and that person
entered on your keyboard.
So now the error is gone but now you may actually encounter error regarding actually important actually
and write that widget.
So let me hear at the top you can see these imports statement.
If I open it here you can see this plus sign here if I click on it here you can see that I auto imported
this and write that widget that takes you if you see any errors here regarding importing their takes
view class to our file.
You need to put this line of code here import and write that we did to take that view but I also imported
this class to add to my file.
How did they do that in the next tutorial.
You are going to learn about that.
So thank you very much for watching and I'll see you in the next tutorial.