So here we have a like fragment and the name of art.
Like fragment is animal cuius results right.
So now let me show you the emulator as you can see here.
This is our dialogue and here as you can see this is actually a description that let us know about the
results of the quiz.
So now let's go inside this.
They like fragment.
As you can see here we have this method here.
Uncreate dialogue right.
So this is going to be called a venti de-lurk is actually created.
And now as you can see here the return type of this method is dialogue and this it actually accepts
an argument of type Bondel and the name is saved instance state.
So let's go inside the Smurfette And let's see what's going on here in LA.
Number one hundred and fifty two as you can see here.
Here I actually created a builder so alert Stalock that builder and the name Is that right.
New assignment operator new ALLERT de-lurk as you can see here that bill there and here are this bill
that he actually accepts an argument.
So here we need to pass the context.
So the context is going to be good activity.
So this activity method as you can see here does get actually with him if it can actually give us the
context.
So automatically we can actually get the context by actually using this method.
Good activity.
And now we have an object that object a number of one hundred and fifty three.
He had I actually referred to the name of this builder so builder that said message.
So here we need to set a message of this builder.
And now you can see here again I called the Smurfette get strange.
So now let me show you the emulator as you can see here we have this value.
This thing value 10 number of guesses.
Come on.
And one hundred point zero zero percent correct.
So let's think of it.
And now as you can see here for the first argument I need to actually pass this Thring resource value.
So our thoughts throwing darts results underlines Thring underlying value but we haven't actually added
this disvalue to the strength that thinks that exemplified.
So let's copy this name here.
This results the string underlying value here and now.
And now let's actually go inside the strings that exemplify it.
And here let's actually create a string here sort of just open a tag and just type in here strange and
the name is going to be that's valued at.
We're doing that we're actually pasting here results on the length strange underline a value as you
can see here.
And now let's actually close this tack here.
And for the value I'm going to pasting a value here and then I'm going to explain to you what's going
on here.
So as you can see here this is the value that I pasted here inside this attack here.
So for the first argument per cent one dollar sign D as you can see here this is the first argument.
Number of guesses come on.
And as you can see here we have actually a floating a value or the symbol value per cent to a dollar
sign point zero to f percent percent.
So what does this mean.
So this means that here as you can see this person 2 means that this is going to be our second argument
dollar sign here.
Again this is actually a format that when we need to put this dollar sign here in order to specify that
we are going to actually put an integer.
Actually our value may be an integer value or a floating value or this dollar sign here is necessary
you need to put a dollar sign here in order to in order to specify here that this is actually an argument.
So percent to dollar sign means that this is going to be our second argument.
So because here I want to specify of the similar value of floating number.
I actually put this thought here 0 2 so this 0 zero here means that we are going to have two similar
values two values after the decimal digit right.
So 0 2 F again because this is actually a decimal value we need to put this if here as you can see here
because this is actually an integer value.
We put this here.
But here we have a similar value.
If we put f here and here because I want to actually show that to the user the percent character I put
this person's character here twice.
OK so if it if you want to show the person's character with the user you need to put this person's character
twice here right.
So percent percent and it's going I should show it to the user.
The person here as you can see and then as you can see correct I actually put this value here correct.
So 10 for example here 10 number of guesses.
Come on.
And 100 point two of one hundred point zero zero percent correct.
So that makes sense.
And now let's actually go inside this main activity fragment that you have a file here.
So as you can see here Bill there are that.
So I believe that that message as you can see here gets thrown out.
So I call this method.
So for the first argument again I actually referred to that string resource or that string.
That results underlines the value.
Here for the second argument of this gets three Meffert.
You need to specify the number of all guesses.
So as you can see here if I go back inside this string that exemplified it to specify the first argument
right.
One dollar sign.
So this is going to be an integer value.
So let's go back to our main activity fragment out of a file.
So a number of all guesses here is going to be the first argument number of all guesses as you can see
here for example 10 number of cases.
And as you can see here we are actually calculating the percent right here.
We are actually calculating the results so that we can actually show the results to the user.
So inside the Prentice's as you can see I am actually putting I actually put this operation here 1000
divided by and here as you can see I am actually to cast in this number of all guesses as you can see
here.
I am actually casting at this value which is an integer value to a double value.
Right.
So temporarily we have a double value.
We have actually a double version of this value which is actually integer.
So number of all guesses which is now a double.
So 1000 divided by number of all guesses.
So because he had kissed all of the questions right and we had only 10 number of guesses.
So 1000 divided by 10 results in number of 100.
Right.
So because this is actually a double value it gives us a double value.
One hundred point zero zero percent correct.
So this is how we calculate the results and we can actually show that result to the user.
So hopefully that makes sense.
And here as you can see in line number one hundred fifty seven.
Bill there I actually referred to the name of this builder that said positive pot.
And so as you can see here we have a button here reset the animal keys right.
So if you actually click on the spot in here the animal is going to be restarted.
And then we can actually again play with our quiz game.
So Bill there that's a positive button as you can see here.
So for the first argument as you can see I actually specified this are three dots.
Reset animalcules right.
So now let me ask you to show you that if any to actually provide this string the source inside are
strings that exemplified.
So let's actually copy this value here and now let's actually go inside this string that exemplified.
And here let's create a string resource.
So just open a tag and just type in here straight.
And for the name just a paste that's value here.
Reset underline more underline quis right and then close the stack aren't afford the value as you can
see here again just for example typing here restart or just typing reset.
Or you can actually put other values here or I can't just type in reload it doesn't really matter what
you put here.
Restart restart squeeze restart animalcules
right.
And now I can actually go back inside our main activity fragment that of a fight.
And now as you can see here the error is gone.
And here because I want to specify a button for this dialogue as you can see here.
I need to actually first specify devalued the name of the button which is disvalue reset underline animal
Underland quiz for the second argument as you can see here.
I am actually creating our on our listener for that Potten.
So whenever the user touches the spot in here this dialog is going to be notified and it's going to
actually respond according to that are actually not so new dialogue interface.
So because I want to create a listener for this button inside this dialogue we need to create a list.
And unclick listener for this dialogue interface so new they like interface that unclick listener so
it can actually create an anonymous class that actually conforms to this unclick listener interface.
And then it's going to actually over I dismiss it here for us.
So unclick And as you can see here it is unclear if it accepts two arguments.
The first one is the dialogue interface.
Then is dialogue and the second one is actually an integer and its of its name is which.
So it just means that which one is actually selected.
So here it is because we have only one button here.
As you can see when I click on that our application is actually restarted it always is that is reset
and we can actually start over.
So I actually called on my feet here reset animalcules.
Right.
So if any is that it actually touches that spot and dismiss it here is going to be executed.
Reset animalcules but we havent created this method yet.
If you are going to actually create the Smurfette later in our code but for now just put this value
here.
As you can see and now here after this Meffert after this lesson and actually as you can see here you
need to actually turn as you can see need to return value of type dialog from this uncreate dialog Meffert.
Right.
So here I actually return just typing here.
Return builder does create.
Right right.
So it's going to return a value of type dialog.
So it is very important that you put this line of code here before the curly brace of this uncreate
large here and now as you can see at the bottom here you can see that we have this animalcules results.
They like fragments so as you can see after the in curly brace of the Stalock fragment.
Now you need to actually call two other methods here.
Animal Marquise results.
So this is the name of art.
Actually they like fragments right.
Animalcules results that said Transurban cancelable false and this means that for example Lydney actually
does this.
And once again here and there and because I want to actually show you the dialogue again.
So as you can see here this is our dialogue here and now as you can see we can't actually cancel this
dialogue right.
If they actually click on here or here we don't have any options in order to cancel the Stalock we must
actually click on the spot and reset the animalcules.
So that's why I actually put this method here the results.
So these are dialogue that said cancelable false.
And in this way we cannot cancel this dialogue.
The user must click on this button in order to reset the keys.
And in line 151 as you can see here I actually referred to the name of this animal quiz results.
Here again this is our dialogue.
Sure.
So we need to actually call this method show on our animalcules results.
So that is going to actually show this to the user.
So animal quiz results that show and for the measure there should access to argument.
The first one is actually the fragment manager when it was specified the BRAITMAN manager.
So in order to put that value here you can't just simply refer to that to the name of the Smurfette
get fragment manager.
So it's going to automatically give us the fragments manager comma and for the second argument we need
to specify the tack.
So the tag could be any values but I recommend that you actually specify a meaning full value and the
Marquise results.
So this is the tag that we need to specify here.
So as you can see this is actually the osting value and then it's going to show that I like to use it.
And here we have an else statement.
So now as you can see this statement here is really is actually related to this if statement If number
of right answers is equal to number of animals included inquiries.
So if they use that as I should it just all the questions right.
And now we have we have an else statement.
So this means that we haven't seen or finished the quiz.
So if we actually click on these resets the animalcules here is going to reset the quiz for us.
For example now if I actually click on this dark here it's going to wait.
For example one second or two second and it's going to show us the next image.
So if there actually is not actually if there actually a quiz is not finished yet.
If the user needs to for example answer some more other questions inside our quiz then it's going to
execute this statement.
So in other words this if statement here is actually determining whether this quiz is actually finished
or not.
OK.
If the number of right answers is equal to a number of animals included in inquiries then this means
that the quiz is actually finished and that's the time that it's going to actually show that to the
user that you like.
But if the quiz is not finished yet so he's going to actually execute this statement.
And here I actually referred to the name of this handler.
So I actually declared this handler here inside our class as you can see here this is our handler in
line number 44 and we actually initialized this handler inside our uncreate view Meffert handler assignment
operator new handler.