Hi everyone in this theater I a touch about spinner in Android.
So let's create an android studio project so the name of the application is going to be Spanair in Android
and that you can specify the company domain the package name and the project location just going to
the next dimension is going to be as always.
API 16 Android 4.1 jellybean for phone and tablet next.
And here is empty activity next.
So here are.
Just don't change anything.
Just click on finish.
Just leave things as default.
So now as you can see here my project is created.
So let's first design the application.
So inside this android structure here just open up this app folder and then open this rest folder and
in here you can see this layout folder.
Just open it and double click and this activity underlayment and examine.
So let's actually close this preview by just clicking on this option here.
This sidebar button actually so that you can actually collapse it.
So let's go to the Design tab.
And now let's delete this.
Hello world view.
First of all at the bottom it's actually just click on the text tab and you can see that we have this
constraint layout.
I don't want this constant entry at least actually to change to a relatively short.
So just select it and just type in here really play out.
And now as you can see the address that you put is relatively healthy it inside is a closing tag.
So let's go back to Design tab.
Let me actually just double click on this activity on the last minute example tab here.
In order to make this area there.
First of all I'm going to actually write linearly as vertical here into this relatively as here.
So this pallet section you can see different taps.
So let's click on these layouts tab and then you can see these options.
Let's select these linearly out vertical here.
Just drag it and put it here at the center of this relatively out and then release it.
So now we have this linearly as vertical here.
Let's write a text into this linearly out where it's called.
So instead these politicians can all select these text view and to strike it here into these linear
layouts where ethical and less actually change the ID to do don't have to change the ID because we don't
want to interact with mistakes from our job because let's change the text of this text view.
So the text is going to be Please select one of.
Please select one sport one sport and that person into the general keyboard.
So that's enough.
Let's actually try a spinner into our linearly out of vertical.
So in order to actually use our spinnet into our linearly spectacle that's actually at the bottom just
click and this takes tab here at the bottom.
So here I want to show you that you can also create a user interface component just by using XML codes.
So now I am I have this relatively out right inside this relatively out.
We have this linearly out and inside it linearly and we have these takes you can also take a look at
the preview by just clicking on this preview button here.
Now let me close this preview.
So after this takes you I am still inside this linearly.
Right.
I can actually create a spinner or just open attack and just open spinner and just press on and can
you keyboard just select this option and then press on until you on your keyboard.
So we have Android that support that visitant that widget that app compered spinner.
So for the layout we just assign the value that content.
And for the layout height also assigned the value or content.
OK.
So now let's specify an ID for these spinners so just came in here already and just this one an at sign
Plus Id choose this one and then present it to your keyboard.
So not after this slash I can specify the item.
So it's very important that that you when you want to specify an item for a component first add sign
Plus the slash after the slash.
I can't say spinner.
So this is going to be the ID.
Right.
So now we have the sticks and this and this spinner.
And take a look at this preview.
We have the stakes here and we have this spinner.
So let's see how we can actually use this spinner.
Let's open the Andray structure here looking at the top just click on view windows and then click on
project in order to actually the height or actually show this view here.
Now let's open the app folder open the rest folder and then open these values folder.
Just click on these things that XML file.
And now we have these resources here.
I want to create an R-ALA resources.
So inside these resources Tadg I actually put an opening tag and just type in here.
So select is one string at a certain name is going to be sports underline name sports name and then
just put a closing in here.
So now we have this closing tag and R8 right.
So insert this at a.
I can actually put items.
So just open attack item and then close it but just putting a closing tag and inside this tag I can
just type in the first spot.
Could be football I can create another item here.
So again hit him and then close it.
And the second spot is going to be for example boxing.
Let's create another sport.
So the first stop at the first sport is going to be for example teach boxing.
Open item.
The fourth one is going to be body building for example body building.
And let's create another item so here I can get you to say take one do
OK.
And here I can create another item.
So the last one is going to be to do.
So that's enough.
OK so we have actually a strange array.
And inside this area we have these items.
So these are the elements of this Adye.
So now let's go to main activity of a fight.
And first of all of you to actually create some valuables inside this class.
So the first one is going to be actually spinner and the name is going to be Spino semicolon.
I just declare this valuable here.
And the second one is going to be adapter and the name is going to be adapter's semi-colon.