So as you can see here these are the lines of code that I actually pasted here.
So for example I want to actually delete of the first elements inside our list view.
OK.
So first of all we need to check that if you have actually any of the computer objects in sight are
all computer at least OK.
So if all computers.
This is actually a list that holds all the computer objects in sight.
It's too late.
So if all computers start size is greater than zero.
And this means that if we have at least one computer object in sight are all computers these are ok.
If the number of objects in sight are all computers at least is actually greater than zero.
Then if this expression evaluates to true then it's going to execute these lines of code here inside
the curly braces of this statement.
First of all it's going to actually remove the first element that exists inside these computers name
at least as you can see here.
Computers name that remove the first element is actually the index the value that we specify for the
index 0 OK.
And it's going to actually delete the value that is inside of the index 0 of these are a list and then
we want to actually delete that object that computer object inside our school.
OK so a database handler that deletes computer.
Ok this is actually a method that we put inside our school I'D handler class.
Right.
So they tell us handler that deletes computer on here as you can see.
I referred to the name of these all computers least that get zero.
So you can actually delete the first object the first computer or object that we have inside of all
computers at least as you can see here.
OK.
So here I specified the Index index zero.
So it's going to delete the computed object that we have inside the index zero of all computers.
At least here.
OK.
So it's going to delete that computer.
So as you can see here I put this piece of code here in order in order to get the first computer object
that we have inside our all computers list and it's going to actually delete that computer inside our
database.
OK.
And here in line one hundred and six as you can see.
I want to actually delete that value with that computer object from our all computers list.
OK so all computers that remove.
And here I specified the index zero.
OK so it's going to remove that object computer object from our all computers list.
And here we have an else statement.
As you can see here statement means we don't have any of the computer objects inside our computers.
So if this expression here evaluates to false.
OK if we have no computer objects in sight are all computers at least then this statement here is going
to be executed.
And here we want to return from are from this case a statement is not going to actually execute the
lines of code after this.
A return statement.
OK.
So it's going to return out of this method.
And it's not going to execute the lines of code after this statement.
As you can see here and if I if I want to actually execute city AT&T that case here I need to click
on that delete button once again.
OK.
So that's the meaning of return here.
All told you about this written statement in the previous tutorial.
And here we have this break statement.
OK.
So after this switch statement here as you can see we have the switch statement here.
Right.
So this is the kernel.
These are the curly braces that are related to the switch statement.
So after this three statement I can just refer to the name of this adapter object Dadds notify data
set change.
So this method is not if I said change is going to actually let the adapter know that we want to actually
that the data is actually changed.
OK.
And it's going to update itself and it's going to actually show the updated values inside our list view.
So if it is going to update the list view so that we can actually see the updated values for example
if we use the phrase as an object into the database and it's that object is going to be for example
added to the computer's name at a we need to call the Smurfette in order to see that object inside our
list view otherwise.
And if we don't call this method here is it after that notify changed.
If it is not going I should update the list view and bitch and we would be not and we would not be able
to actually see the object to see the added objects or the deleted objects.
So this is very important that you actually put this piece of code here and after that notify data set
changed.
OK.
So hopefully that makes sense so remember that here I put this piece of quote He had this line of quote
he had inside this uncle for as you can see here.
OK.
So hopefully that makes sense.
And now let's actually on our project and see what happens.
So as you can see here our application is running on this emulator here and here as you can see we have
these editrix see that and we have this at the bottom.
And this delete button.
So analysis actually assign a value for these computer name.
So for the computer name I can just typing a match.
And for the computer type I can just typing a desktop desktop computer.
OK.
And then here if I click on this add what's in here.
Now as you can see this value is going to be added to our list view.
I imagine Dasch desktop computer right.
And if I click on this delete button here that's value is going to be deleted.
So that may actually at that's about you again here you match and of for the computer type computer
or this computer is.
Excuse me.
Desktop computer.
And then click on Add.
And again I want to actually add an order of audio for the computer name.
So iPhone for example iPhone 7 and for the computer type I can just type in our mobile computer mobile
computer and then if I click on this button here it's going to add value to our list view and for the
computer.
Again I want to add another value for example galaxy galaxy is six.
And for the computer type I can just type in a more wide more wide computer.
And here if I click on this and put in here that value is going to be added to Odlyzko view right.
So now you can actually click on dispatch button here and if you actually click on these background
applications and if I actually close this application now.
Now if I open this application again here at 58 now here as you can see these data are actually deceived.
OK.
I actually added these data to my database and those that are actually being retrieved from the database
and I can see those data.
So those they thought actually saved inside the database.
And if it's for example one of them and here for example I deleted all the computer artex and this one
remains.
And if I click on dispatch button here or if I actually close this application here completely and if
I open the application again here.
Now as you can see here this data is actually saved and those data that I actually deleted a few seconds
ago are actually gone.
OK.
Those They are not here we just can't see the value here.
OK.
And in this way you can actually save your data or delete data from the database here as you can see
in say this is your LATE handler class I actually added some other methods for example updates computer.
You can use this method in order to update a specific item inside your list view.
OK.
Or for example get computers count or other methods.
So this is how you can work with as too late.
So for now just make sure that you actually learn all these concepts that taught you are in this tutorial.
Please if you have any questions please post the discussion in the course and then I'll do my best to
answer all of your questions.
Thank you very much for watching.
And I've seen the next tutorial.