And I actually tested some padding for these values OK for the left padding This is one hundred for
the top zero for the right zero and for the bottom zero.
OK.
And then I actually assign a color to this view.
Ok text color.
And as you can see here the colors of these are actually the color of these group names are actually
blue.
OK color blue.
And actually sets a size to the stakes to view the size of these values is actually 40.
OK.
And I asked you to returned this takes you.
OK.
And as you can see here the Smurfette this gets group view if it actually returns a value of type view.
OK.
And this text is actually a subclass of view.
OK.
So we can actually turn this text view from the Smurfette.
And as you can see here these are the values that this method actually retains.
OK.
So hopefully that makes sense.
And now we need to actually return the children of these group views as you can see here sport class
as you can see this sport view actually has some has our children as you can see here this sport if
you have children.
OK so if anything I should return these values from this good child human effort.
OK.
So this is for actually the returning the children of these group views.
OK Computer as you can see here and other values.
So here let's actually did it is written not here and now we can actually put in our own implementations
inside of this method.
So as you can see here this is actually the return a value of type view.
And we have group position child position is last child.
This is actually a boolean argument and we have this convert view.
So we can actually to change these arguments and into view.
And we have a view called a parent OK.
The players are actually the parent of these children.
OK so now I'm gonna paste in some lines of code here and then I'm going to explain to you what's going
on here.
So as you can see here these are the lines of code that they actually the pace that he had inside of
this method.
OK.
And as you can see first of all again I created an takes object.
OK.
Takes the view assignment operator.
Here I am initializing this object new text view and then for the constructor of this class I need to
assign a value of type context.
So this is context.
OK.
And then as you can see here inside of our emulator we have these techniques the view that takes the
child names.
So these are the child names as you can see we have this as a child names.
This is actually a two dimensional array or an array of arrays.
OK.
So child names girl position.
So if you have this group position here.
OK.
Sup child position.
OK.
So we can as you can see we have this sport boxing kickboxing judo football basketball.
OK.
So the group position is sports.
OK.
For example for their first group position this is zero.
OK.
So the this group position if this group position is zero this value would be sport.
And as you can see if you have this Chinese position these are the columns as you can see we have these
values that are inside of the actually index zero of these child names two dimensional array.
OK.
So it's going to return these values to us.
OK.
As you can see here these these are the values.
And here I am actually setting some setting the padding of these a text view.
OK.
One hundred for the left 0 for the top zero for the right and a zero for the bottom.
And as you can see the color of these child children as you can see here this takes views that are inside
of this group as you can see this is red.
These are the colors of these attacks.
It is red as you can see and the size of these text views is actually 50.
OK.
So hopefully that makes sense.
And I actually specified a certain click listen for this text view the view object as you can see here
if I click on these children is going I should respond.
OK.
But there is an error here.
So here I actually created a tossed object toast that make text Our first we need to specify the context
and second we need to actually specify the text that you want to actually show to the user.
And the first argument is actually the length of our applet of the text the duration of the text that
is actually shown to the user.
And then we are calling the shome effect on these toast.
So if I click on this for example each in here it says kickboxing here.
OK.
Boxing boxing basketball.
Basketball OK.
But as you can see here there is an error here.
OK.
And it says that you cannot.
Valuable the view is X is accessed from within a class needs to be declared final.
So as you can see here as I said earlier in this section that are when you create an inner class as
you can see here we are creating an entire class an anonymous inner class and that in a class that anonymous
class is actually implementing this article class in an interface.
And because that class is implementing this interface it can actually overwrite the Smurfette here.
So if we have this anonymous in a class and B inside of this or in a class we cannot refer to a value
to a variable that is not final.
OK.
That is actually not constant.
So here we need to actually declare this text view as final.
OK and now as you can see the error is gone.
OK.
And here after this a Satanical lesson we are returning this TXI the view object.
OK.
And here we have another method.
Is child selectable.
So the default implementation is enough for this Meffert.
If you want to actually find the description about this effort to actually go to the documentation as
you can see here and here inside the search bar I can actually copy the name of this method and put
it here.
OK.
As you can see this is the method.
This is actually an abstract method and the return type of this if it is Boolean is child selectable.
And this method actually accepts two arguments of type integer group position type position.
And this is the description of this method where there is the child at the specified position is selectable.
OK so we can specify that whether each child of this group use as you can see here are actually two
selectable or not.
OK but for this application it is enough the default implementation implementation is enough return
false and now it's actually to go to the main activity that double file here and now let's actually
create an object of these from these expandable adapter.
OK.
So here I can just type in expandable list view adapter and the name of this object is and expandable
this view adapter.
Or I could just name this object as adapter.
OK it is simple assignment operator new expandable adapter.
And as you can see inside the Prentice's for this constructed I need to specify the context.
So inside is expendible adapter for the constructor of this class.
I specified that this constructor actually accepts an argument of type context.
OK so here of any to actually pass this context and this context with the past to this context instance
worry about OK.
So here again just typing our main activity that this.
OK so this is the context.
I mean I think that this this is our class.
And here I can just type in expandable this view.
So if you have this expandable view OK in say this content underline minute example here.
This is our this view.
Now we want to actually bind to data that we actually get from these expandable adapter and put that
they are inside these expandable view.
So here I can't just type in expandable list view that set adapter.
OK.
So here we need to specify the adapter.
So we have this adapter here adapter.
OK so now let's actually run our project and see what happens.
So now I want to actually show you an important point about two dimensional Olly's.
So here as you can see our application is actually running on the simulator.
And if I actually click on this support group view you can see the children of this group view boxing
kickboxing judo football basketball and if I actually click on these items I can see these tossed here
kickboxing.
And now let's actually click on the computer.
Good view here.
And as you can see here our application crashed.
Unfortunately at 35 has stopped.
So let's let's actually go to the log here at the bottom.
And now we can see that here it says our That land that Arey index out of bounds.
Exception OK lead free index free.
So we actually accessed an index of an array that actually doesn't exist.
OK.
And here as you can see it says expandable view adapter does get Chinese view.
So the error is actually the error is actually happened on this MFL tried to view Meffert.
So if I click on this link here.
Now we can see these are actually line of code.
The error actually happened in this line of code and here I am actually getting the children of this
group of group view here as you can see we have this view and we have these child names at it.
So now as you can see here you have these get group count.
OK.
And we have these kids children challenge.