So now in case the value of the bike in uncolored is red then it's going to actually execute these lines
of code here.
As you can see.
So first it's going to actually set the background color to read and increase linearly out that set
by your own color color that red.
So now let me show you the emulator.
So now as you can see here our application is running on this emulator.
And now let's actually go inside the setting activity and here let's actually change the background
color to red and now it says new changes are applied.
And if I click on the spike bash button here at the top as you can see the background color is now red
and here is when I try to execute this for loop here.
So it's got it right over the values of these rows of spottiness in animal cuius as you can see here.
And then it's going I should put this inner for loop.
So in Cullom 0 and then it's going to execute this.
Actually it is a follow up until the value of this column is less than the value of the child count
of this row.
And then it's going actually that adds one value to the value of this column variable after each execution
of this war.
So as you can see here here we are actually creating a reference to these buttons as you can see.
And then here we are actually sitting back and uncolored of these buttons two colors that's blue.
So the back in uncolored of these buttons is by actually blue and button that takes color the color
that white.
So as you can see it actually takes Colored of these buttons is actually white right.
So now we are setting the color of the answers to colors that white.
So now if we actually choose elephant here as you can see now the color of this the X the answer is
white.
And here we are sitting that here is the question number two color dot white.
So as you can see the truly the color of this asks the question number is white and he had finally you
can see this brave statement and now we have this case statement as you can see.
So in case the value of the bike and color is actually yellow.
So now let me actually go to the settings activity.
And now let me change the background color to yellow as you can see here.
And now if we click on dispatch button here at the top.
Now as you can see here the Paglen colored is yellow soap and it will quickly lay out that set back
in and color color that yellow.
And here again we have the for loop in order to try to iterate over the buttons that we have here inside
the squeeze.
And we're going to actually set the back in uncolored of the spot into black.
So let's actually look at this for loop here linearly out row and here and here is going to iterate
over the values of these rows of guess spottiness in and Im always Aure And here is can actually execute
this inner for loop.
So for int column and the value of this column is 0 initially.
And here it's going to execute this for loop until the value of this column variable is less than the
value of this child count of this throw.
And then actually it's going to increment the value of this column by one after each execution of this
for loop.
And here we have actually these lines of code so here you are actually creating a reference to these
buttons.
And here as you can see you're setting the background color of this button to color that black.
So the background color of these buttons is actually black.
And here we are starting the text color of this button to color that white.
So as you can see the text color of these buttons is actually watched.
And finally we are certain that the answer that takes color as you can see here to color that black.
So now let me address the animal beard and here as you can see that the answer colored is black A.S.C.
question number that takes colored colored That black.
So as you can see here the color of this takes the question up question number is actually black.
And finally we have this black statement.
So now so now that we have these Moffats here inside this main activity fragment of a fight literally
to go inside say this main activity main activity or double file here and now literally go inside this
man with the class.
And here we're going to actually put some lines of code inside this on shared preference changed method.
So remember that I told you this if it is going to be executed every time we actually change the settings
of this application so I can see for example when I change the number of guesses here.
Does class this mean activity classes actually a listener and this class is going to be notified of
these changes.
So for example if I change the background color This class is going to be notified of those changes.
And every Actually every change that I make to these settings this class here this man computer class
is going to be notified because I actually make it make this class a listener to those changes.
As you can see here if you look at this line of code here preference manager that gets the file sharing
preferences.
First we pass this context in order to specify that this class is going to be the listener.
And here we are calling this method on this actually on this object.
So that register on shares through friends change listener settings change listeners.
This is the name of this listener that we specify in this class.
And as you can see here I actually created this listener here inside this class and here we need to
actually provide an implementation for this method.
Right.
So analysis actually I'm going to paste in some lines of code here.
Inside this method and then I'm going to explain to you what's going on here.