And this view object as you can see here began by using this view object we can actually differentiate
between these two listeners.
So here I can just typing switch and here I can just referred to the name of this object that as you
can see this is an argument of this Smurfette.
OK.
So again just typing V.
OK that's good idea.
OK.
And now I can actually switch between the IDs of my user interface components.
OK so case are thought Id dot DXi value.
OK colon.
And then I can actually put this code here.
OK I can cut this code and put pasted here.
OK.
And again just putting the previous statement here.
OK.
And I can't just put in another case here case or that Id dot EDT value colon.
And here again just typing TXI the value that says text.
OK.
And here I can just up putting the value of these EDT value OK to these RTX the value object.
OK so I can just type in EDT value.
That's just text.
And now let's actually run our project.
But before that it's actually break here.
Put the break statement and analysis actually on our project and see what happens.
OK.
So as you can see our application is running on this emulator here and now it's actually putting in
some text here for example.
Life.
OK.
And now as you can see I mean these are EDT value object.
A listener to the clicks of the user.
OK so here if I actually click on this Eddie takes here let's see what happens.
And now as you can see the takes of these takes you actually changed.
OK.
And that's because of the execution of this line of yet.
OK.
I specified that when the user actually click on these text object.
This line of thought is going to be executed TXI the value that said text.
So as you can see this is the this is that the value object that set text editing value that get text.
So it's going to actually put this text to these text view object here.
OK.
And let's actually turn this up takes me here and now as you can see the text of this text view the
color of these attacks has actually changed to the red color.
OK.
So hopefully that makes sense.
And and this is how you can actually differentiate between these are Uncle listeners.
OK.
So now let's actually put in some more lines of code here.
Inside of this class.
So now I haven't actually talked about about these autocomplete takes.
And these are multi autocomplete text view.
So as you can see here these two components are actually another kind of text objects.
But before I actually teach you about how we can actually use these two components I need to actually
teach you about the adapters and.
OK.
So adapters are the link between a set of data and the adapter view that displays the data.
OK so what is an adapter view and adapter view actually after views our view groups that display tyed
views given to it by an adapter or shape.
Adapters also provide the child views that display the data in the adapter view.
OK so adapters are actually responsible for supplying the data and then actually creating the views
that are present in each of them.
In this tutorial I want to talk about Aure adapter.
So what is an hourly adapter an hourly adapter adaptor is an adapter backed by an array of objects.
It links the ARII to the adapter view.
OK so the default right arm adapter converts an array item into a string object.
Putting it into a takes you the takes view is then displayed in the adapter view.
OK so when you create the adapter you need to supply the layout for displaying each of the screen.
OK.
Let me actually show you an example.
And then it's going to make sense to you.
So first of all I'm going to actually pasting some lines of code inside of this class and then I'm going
to actually explain to you what's going on here.
OK.
So here inside of this class I can actually paste in some lines of code and then I'm going to explain
to you what's going on here.
So here as you can see I actually created an array of string values and the name of this at a course
names and here as you can see I actually assigned these these values to these of course names locate
an inline 23.
I actually declared an object of type.
I wrote it after and I actually said that these are is going to actually hold string values.
OK.
So now our inside of these are uncreate Smurfette.
I'm going to actually instead initiate these two.
This actually does it at an object.
OK.
So here I can just type in my adapter assignment operator new.
OK.
And then again I need to reverse the name of this Arey it after a class.
Ok I read it after.
And inside the prentices as you can see we can use lots of actually constructors.
OK as you can see a diskless has lots of constructors.
So now let's actually go to the web browser in the Android documentation and then I'm going to explain
to you what is actually an array adapter.
OK.
So let's actually open your browser and as you can see here we've got this great adapter here.
And as you can see here it says our concrete base adapter that is backed by an array of arbitrary objects.
OK.
By default this class expects that it provided the resource ID reference as a single text view.
OK.
And here you can see some descriptions about this class.
OK.
And here as you can see we have this jobs that like object and the subclass of this class is for example.
And with that widget that base it after Aunty's it that it actually inherits all of the features and
behaviors that are inside of the space adapter.
OK.
And this class actually extends space adapter and implements of filter filter about our interface and
these feed spinner adapter.
OK.
So here you can see some summary about this class.
And these are the public constructors as you can see.
You need to actually open your browser and enter this you are well and then you are going to be guided
guided to this space here.
OK.
So we have lots of constructors here.
OK.
But we need to actually use this constructor here first.
We need to specify the context.
OK.
And so the context is the class the current class ok and the resource is actually the view that we want
to actually put these objects as you can see these objects are the first argument we want to actually
put these objects through the view on the screen.
So now let's actually go back to the Android studio and then I'm going to explain to you what's going
on here.
So here first of all I need to actually specify the context.
So main activity does this.
So now I just need to put in a comma here and then I need to actually the first one resource.
So here I can just type in Android that are dot layouts.
OK that's.
And here we can actually select one of these simple items here.
So I just select this simple list underline IDM underlined one here.
OK.
So this is going to be our view for putting are actually storing objects that we actually assigned to
these arey.
OK.
So here again just typing course names.
OK.
And then I need to put in a semicolon at the end of my statement here.
So here as you can see I created my ADD my editor here.
And so what's the job of this.
What's the job of these autocomplete takes to do this autocomplete takes who is actually like the Eadie
takes object.
OK.
And is it is like other textfield there is a difference between this edit text and these edits.
This autocomplete text you actually gives us some hints.
OK.
And we can actually provide those hints by actually creating an array.
So these are values that they actually assigned to this.
Are they all going to be the things that we are at this autocomplete takes view is going to actually
give the user.
OK.
So that's why we need what we needed to actually create an array adapter object.
OK.
And Dan are here as you can see inside of these uncreate Meffert.
I actually initialize this object by putting my adapter object assignment operator new Aure adapter.
OK.
And here I specify the context.
And then here I actually refers to this simple list.
I don't want this is going to be the view that we want to actually put in.
This of course names with this view.
OK.
And then I need to actually bind this autocomplete with this adapter object.
So here I can just typing autocomplete takes a view that sets adapter and then I need to revert to the
name of this object my adapter.
So now let's actually run unprotect and see what happens.
So as you can see here our application is running on this emulator here.
Now if I actually click on this autocomplete text view.
So here if I want to actually type in Android and as as you can see here it going to give me this hint.
So this view as you can see here this view that this android develop develop of course takes is actually
inside it.
This view is these are simple list items as you can see here.
OK.
So that's why we needed to actually put this list item here.
OK.
And through that art that lay out OK that simple list item one.
OK.
And as you can see here I could actually put in this text here.
OK.
Or I could actually put in other values for example Java.
And as you can see here it's going to give me this hint here.
Java developer of course.
Or I could just they pin all us.
And as you can see here it says our U.S. developer course.
OK.
So now it's not going to actually give me for example multi multiple Hinz.
OK.
For example multiple hints that are actually separated by cut by comma.
So that's the job of these multi autocomplete takes to you as you can see here.
So now let's actually go inside this main activity that double file here in order to see how we can
actually use this multi autocomplete text view Arjay.
And now as you can see here we already instantiated this my adapter object.
OK.
And here again just typing multi auto completists view that sits adapter.
OK my adapter and for multi autocomplete text we want to actually call another method on this object
here.
So here I can just type in multi alter autocomplete takes few dot sets.
Tokenizer OK.
And as you can see here it is tokenize it actually accepts an argument of type tokenizer.
So here I can just type in new multi autocomplete text view dot com on tokenizer.
So as you can see here this set tokenized and if it is going to actually put these commas after each
value that we've actually putting in inside this multi autocomplete takes three.
OK.
So a tokenizer new multi autocomplete takes few dot com or tokenizer.
OK so it's going to separate these values by comma.
OK.
So let's actually run our project again and see what happens.
So as you can see here our application is actually running on this emulator here.
And if we actually select these multi autocomplete text view it's actually just typing in Android.
And as you can see here it's going to give me this hint here.
And as you can see it put this come here and then I can actually putting us on here as you can see it
is actually giving me another hint.
OK so that's the job of these multi autocomplete takes you.
Or just another putting another value for example Java developer of course.
OK.
So hopefully that makes sense and I think that's enough for this story.
And if you have any questions about these concepts that they actually talk to you in this tutorial please
post the discussion in the course and then I'll do my best to answer all of your questions.
Thank you very much for watching and I'll see you in the next year Tauriel.