So now that we know that we have this handler here and now we know that this hand really is actually
initialized Let's actually scroll down here.
Now let me show you this statement here.
As you can see this is the part that is going to be executed right.
So now let's look at this block of code here.
As you can see inside the curly braces of this statement we have this handler we referred to this handler
that post late.
So now let me show you the emulator as you can see here.
Now we have this eagle here.
And now let me actually choose eagle here as you can see here.
It weights about one or two seconds and then the next question appears here.
Right.
So now let's actually go back to our Android studio.
So here I referred to his handler handler at that post delayed.
So now when I tried to evade it and when I tried to create a delay here.
And then the next question appears.
So handler that post delayed.
And then he had to create a new runnable object so new runnable and then inside the curly braces of
this runnable here as you can see now I can actually write this run Meffert here and then it's going
to run animate animalcules.
True right.
So for example here we have a cat and if we actually select this cat here it's going to wait about one
or two seconds and then the next question appears here at the next image appears here.
So inciter run if we need to actually put the lines of code that we want to actually execute after that
amount of time that we specify here.
So as you can see here after the end in praise of this actually posted a method as you can see here
we have a comma.
Right.
And then here we need to specify the amount of time that we want to wait.
And then we can actually execute this run method here.
So for example here after one circuit as you can see here 1000 milliseconds as is actually for one second.
For example 2000 two thousand milliseconds is actually four to six.
As you can see here he actually created a comment and it says two thousand milliseconds for two second
delay or for example three thousand milliseconds for free second delay.
OK.
So after this amount of time that we specify here the run method here is going to be executed.
So that's the job of this handler here.
And now let me specify that all these codes are actually executed in India.
Actually if it is in the user interface in the GUI actually Fred in the User Interface Fred.
OK.
So for example here we have a snitch and effectually select a snake here about for example.
Two seconds.
It's it's going to evade and then it's going to execute the run method.
As you can see here which is this Meffert animate animal cookies and then the next picture the next
question appears.
And then as you can see here we need to actually create this Meffert inside our class and this method
accepts an argument of type Boolean.
And here I assigned you to.
So it's going to animate the squeeze.
And then it's going to change that question.
So let me explain here again.
What's going on so now let me delete this comment here.
Now let me explain this as a block of code here.
Again here we have inside this Else statement.
We have this handler that post delayed.
So this method is going to actually do something and it's going to actually keep us an option in order
to do something after an amount of time.
So handler that post delayed new runnable So we need to create a reasonable object here and that here
inside the curly braces as you can see I need to override the run method and then I can put the lines
of code that you want to be executed after this amount of after this amount of time here as you can
see here.
After this a comma.
Right.
So you actually overwrite that on Mefford And then after the comma here as you can see if you can actually
put the amount of time that you want to wait that after that it's going to actually execute this method
here.
So for our application I want to actually rate 1000 milliseconds which is actually even just for one
second delay.
So hopefully that makes sense.
And now as you can see let's see what is the else statement here.
So now let me actually.
So before the end in curly brace here before this statement as you can see here we have this.
And the curly brace and here you can just double click here in order to see to the lines of code that
are inside of this block.
So as you can see here we have this statement and it says if this value that equals and value and this
means that if the user actually gets the animal right animal name right.
For example here we have a horse and if we actually chose if we choose this horse here this means that
here this block of this expression here evaluates to true if gets valued that equals and sell value.
And if this means this means that the user has just the animal name it true right.
OK then he's going to execute this if statement otherwise.
So for example here we have a left leopard and he had used this horse here and here it says no right.
So otherwise if this expedition here evaluates to false then it's going to actually execute this statement
here at the bottom.
So by double clicking here before the end in calibrates you can see the lines of code that are inside
of this block.
And then you can actually differentiate between your blocks of code here.
Right.
So hopefully that makes sense.
And now it just means that if they use that if the users case is not right then it's going to execute
this statement or any animal that starts the animation wrong answer animation.
So as you can see here if it's actually de-select shark this is the wrong answer animation right.
If I isolate goes wrong answer animation and then it's going to actually set a text to this.
He actually answers so he actually answers that said text are streamed dot rant and Selma's message.
So as you can see he had the wrong answer.
Message is no.
So let's actually copy disvalue here ran under a line and said underlying message.
And now let's actually go inside these strings that exemplified and then he'll essentially create a
string resource strange and let's paste this value here.
And let's actually close this tag.
And here I can just type in No.
And now let's actually go back to our main activity fragment of a file and here as you can see here
the error is gone.
And now I actually referred to this between and just so between guess is the button that we actually
touch.
So between us that set in a set enabled false.
So for example I touched this horse right.
I can't again touch this button as you can see here.
This button is actually disabled or I can't touch this shark here or can't touch this code but let's
touch this snake.
As you can see this right answer animation is actually occurring here.
And again I can't touch this snake here.
I can't actually press on this snake.
So hopefully that makes sense.
And now let's actually again look at our lines of code here.
Inside this listener as you can see here we have some of these methods here that we need to actually
create.
For example we need to create this get the exact animal name it.
So now let's actually scroll down here.
And after the ending curly brace of this listener which is this ending brace which you need to put a
semicolon here.
Here let's actually create that method to get the exact get the exact name of the animal.
So now I'm going to paste in some lines of code here and then I'm going to explain to you what's going
on here.