So now let's actually look at this piece of code here.
As you can see I am actually dividing the number of options by two.
So now let me show you the emulator here and now let me show you the of the final version of the application
of our Quiz application.
As you can see here now we have two rows here right.
So now this actually click on these settings here.
Let's go inside the settings activity.
And now let's just click on this number of guesses here as you can see now for example I want to have
sex I guess options right.
I want to have sex just options inside my quiz.
So now let's actually click on it and now it says new changes are applied.
And if I click on dispatch button here at the top as you can see here.
Now we have six guest options here.
Right.
So now as you can see we have free throws we have six guest options and we have free throws.
So in each row we have two buttons.
The first row has two buttons.
The second rule has two buttons and the first row has also two buttons.
So that's why here we are actually dividing this number of just options by two.
So for example if the user wants to have for example only two options then for example two.
Now the number of options here is two right here the value that we get from the share preferences from
these key guesses is going to be two.
So here we are actually dividing two by two.
So two divided by two results in the Value.
Number one right two divided by two is one.
So this means that we are going to actually assign that number one to this number of animals get through.
So the number of animals gets a rose is going to be only one.
And that means that we are going to have only one just throw as you can see here.
Right.
One gets through that has two buttons.
So that's why we actually divided.
Number of options divided by two as he has here.
We actually divide that number of options by two and we assigned the result to this number of animals.
Jethro's.
So hopefully that makes sense.
And now as you can see here we have actually a for loop.
And let's look at this for loop here for linearly out horizontal linear layout.
Right.
So now let me tell you that this Meffert here modified animal guestrooms is going to be executed every
time we actually change the number of guesses here.
Every time we change for example the number of options that we want to have inside our quiz.
So for example we want to have only Fortius options as you can see here.
So in that specific time these are here the Smurfette is going to be executed.
So now as you can see did you see what they did here.
I actually created a break point.
So these are great points and these are actually used when we want to actually debugged the application
in a more advanced way.
But I'll touch on talking more about these breakpoints later but for now if you accidentally create
a break point just a click on it and then it will disappear.
As you can see here.
So now as you can see here we have this method modify animal throws.
And this method is going to be called when everybody use it actually changes the number of U.S. options.
And here as you can see for example when I went over here we have to get options right.
We have actually four I guess options and we have to guess Stroh's as you can see.
So now we want to have sex I guess options and I want to have yes rules.
So I just clicked on the sex here and when I click on dispatch button here as you can see the news is
reset.
And now as you can see we have six options.
So we're able to for example change the number of just options.
First I need to actually delete the previous guest options.
So as again as you can see here now you have six gives options and I want to have for example to get
options right now.
First of all I need to actually delete the previous guest options.
So that's what this for loop here is doing for linear out horizontally nearly out as you can see here.
Now you want to actually to either iterate or the values of this are 8 rows of just spottiness in animalcules.
So this it actually holds those linear layouts that we have inside the Cousteau's horizontal linearly
outs that actually contain buttons.
So horizontal linearly out inside the rows of just buttons in Animal cookies.
And now as you can see here this fall here is going to be executed for each linearly out that we have
inside these eight rows of spottiness in animalcules.
So if you actually scroll to the top here as you can see we actually initialized these rows of just
buttons in animalcules inside the uncreate view.
Right.
So now we are sure that this was like a spottiness is actually initialized.
And when I referred to these rows I guess what as in animal quiz we can actually be sure 100 percent
that this idea is actually initialized.
And then I want to eat right over the values of this grape.
Now I can actually say that horizontal linearly out that set with a visibility view that's gone.
So when I say view that God is going to actually eliminate all those linearly outs that we had in the
previous actually in the previous version in the previous settings right.
So now this is actually updated the number of options now is updated.
But when I actually want to change the number of guest options I need to eliminate all those linear
layouts that had buttons just buttons inside them.
I need to eliminate all of all of those linearly outs and then I can add the new.
I took the options.
Then you asked linearly out.
So first I need to eliminate all those previous layouts so linearly or horizontal linearly out either
right over to the values of these rows of spottiness in any McAleese.
So these are other linearly out of the search visibility view that's gone right.
And then as you can see we have another for loop so this for loop is going to actually put the newest
horizontal linearly out then US guest options into our quiz.
So four in a row.
So as you can see here the row is zero.
And here we created a condition that specifies that how many times this for loop here is going to be
executed.
So until the value of this row is less than the value of this a number of animals guess throws.
So this variable is going to hold the number of throws that we have inside the.
Right.
As you can see we assign a value to this right here but here so low plus plus So here we are saying
that after each execution of this for loop it's going to actually it's going to increment that the value
of this sort of valuable by 1.
So let's actually go inside the curly braces of this for a loop here and let's see what's going on here.
So rows of guess spottiness in animal quiz.
So I am referring to these three rows of buttons in animalcules sup row as you can see here rows of
spot and in animal Sabratha for the first time that this group is going to be executed the value of
this rule is zero.
Right.
So when I say rolls I've just put in as in animalcules Sobero is going actually it's going to go inside
the inside this area and it's going to go inside the first index of this Aure inside index zero of this
array and it's going to call this method and that's a value that is inside of the index 0 of this at
a set visibility view that's visible as you can see here.
Now as you can see this linearly out here is actually visible.
So now hopefully you can understand what that what's going on here.
First we're actually getting the number of guest options that we have inside our activity as you can
see here.
For example two four or six foot now I want to actually for example choose fourth.
And then as you can see here we are actually dividing that value by two.
First I am actually converting that value to an integer value.
And then I am dividing that value by two in order to specify the number of actually gets throws.
So and then we can actually assign that value to this number of animals just throws.
So this variable now holds the number of animals gets ROSS Right and then so four divided by two is
actually two right.
And now this means that the value of this number of animals gastos is two.
So this means that we are going to have to guess rules as you can see here.
Right.
And then first I need to actually eliminate the previous guest options.
So for linearly out horizontal linearly out it's going to iterate over the values of this Aure rows
of good spottiness in Animal cookies.
And then it's going to actually set the visibility of those linear layouts to view that gun.
Right so it's going to actually eliminate all of those.
So just notice that we have viewed that invisible.
And we have view that gun.
When I say view that gun is going I should eliminate all those components inside to use an interface.
And when I say that invisible those components are going to be dead inside that use an interface.
But the user cannot see them.
And when I say view that gun is going to eliminate all those user interfaces all those actually components
inside the user interface.
Right.
So horizontally nearly out.
That said visibility review that's gone and then it's going to actually put the newest linearly out
to the USGS options into the screen.
So for in throw until the value of this throw is less than the number of animals gets close and then
it's going to actually add one value to the value of this row after each execution of this fall.
And then we call this Arev rules of guess spottiness in animalcules Sobero.
That a visibility view that visible.
Right.
So hopefully that makes sense.
And now as you can see this is our Actually method for modifying the guests rose.
We need to actually call other methods for example as you can see if I go inside the settings activity
we need to actually provide a logic for this option for this item.
Animals the type of the animals that we want to have inside the crease.
So now let's actually create a method for that here inside this class.