1
00:00:00,270 --> 00:00:04,610
So as you can see here these are the lines of code that I actually pasted here.

2
00:00:04,800 --> 00:00:10,240
So for example I want to actually delete of the first elements inside our list view.

3
00:00:10,320 --> 00:00:10,930
OK.

4
00:00:11,100 --> 00:00:16,590
So first of all we need to check that if you have actually any of the computer objects in sight are

5
00:00:16,650 --> 00:00:18,520
all computer at least OK.

6
00:00:18,600 --> 00:00:19,980
So if all computers.

7
00:00:19,980 --> 00:00:23,930
This is actually a list that holds all the computer objects in sight.

8
00:00:23,970 --> 00:00:25,030
It's too late.

9
00:00:25,080 --> 00:00:28,660
So if all computers start size is greater than zero.

10
00:00:28,740 --> 00:00:35,560
And this means that if we have at least one computer object in sight are all computers these are ok.

11
00:00:35,790 --> 00:00:41,670
If the number of objects in sight are all computers at least is actually greater than zero.

12
00:00:41,730 --> 00:00:46,980
Then if this expression evaluates to true then it's going to execute these lines of code here inside

13
00:00:46,980 --> 00:00:49,670
the curly braces of this statement.

14
00:00:49,710 --> 00:00:55,830
First of all it's going to actually remove the first element that exists inside these computers name

15
00:00:55,860 --> 00:00:57,550
at least as you can see here.

16
00:00:57,570 --> 00:01:03,420
Computers name that remove the first element is actually the index the value that we specify for the

17
00:01:03,420 --> 00:01:04,850
index 0 OK.

18
00:01:04,950 --> 00:01:11,190
And it's going to actually delete the value that is inside of the index 0 of these are a list and then

19
00:01:11,190 --> 00:01:16,100
we want to actually delete that object that computer object inside our school.

20
00:01:16,140 --> 00:01:19,710
OK so a database handler that deletes computer.

21
00:01:19,830 --> 00:01:24,270
Ok this is actually a method that we put inside our school I'D handler class.

22
00:01:24,270 --> 00:01:24,860
Right.

23
00:01:25,170 --> 00:01:29,770
So they tell us handler that deletes computer on here as you can see.

24
00:01:29,930 --> 00:01:34,990
I referred to the name of these all computers least that get zero.

25
00:01:35,040 --> 00:01:41,400
So you can actually delete the first object the first computer or object that we have inside of all

26
00:01:41,400 --> 00:01:43,760
computers at least as you can see here.

27
00:01:43,800 --> 00:01:44,430
OK.

28
00:01:44,580 --> 00:01:47,620
So here I specified the Index index zero.

29
00:01:47,640 --> 00:01:53,740
So it's going to delete the computed object that we have inside the index zero of all computers.

30
00:01:53,740 --> 00:01:54,860
At least here.

31
00:01:55,080 --> 00:01:55,590
OK.

32
00:01:55,770 --> 00:01:57,300
So it's going to delete that computer.

33
00:01:57,310 --> 00:02:03,030
So as you can see here I put this piece of code here in order in order to get the first computer object

34
00:02:03,030 --> 00:02:09,390
that we have inside our all computers list and it's going to actually delete that computer inside our

35
00:02:09,750 --> 00:02:10,440
database.

36
00:02:10,530 --> 00:02:11,210
OK.

37
00:02:11,610 --> 00:02:14,240
And here in line one hundred and six as you can see.

38
00:02:14,310 --> 00:02:20,130
I want to actually delete that value with that computer object from our all computers list.

39
00:02:20,160 --> 00:02:22,470
OK so all computers that remove.

40
00:02:22,470 --> 00:02:25,180
And here I specified the index zero.

41
00:02:25,290 --> 00:02:30,680
OK so it's going to remove that object computer object from our all computers list.

42
00:02:31,050 --> 00:02:32,810
And here we have an else statement.

43
00:02:32,910 --> 00:02:39,570
As you can see here statement means we don't have any of the computer objects inside our computers.

44
00:02:39,690 --> 00:02:43,280
So if this expression here evaluates to false.

45
00:02:43,320 --> 00:02:49,980
OK if we have no computer objects in sight are all computers at least then this statement here is going

46
00:02:49,980 --> 00:02:51,110
to be executed.

47
00:02:51,210 --> 00:03:00,330
And here we want to return from are from this case a statement is not going to actually execute the

48
00:03:00,330 --> 00:03:01,590
lines of code after this.

49
00:03:01,620 --> 00:03:02,610
A return statement.

50
00:03:02,610 --> 00:03:03,180
OK.

51
00:03:03,450 --> 00:03:06,450
So it's going to return out of this method.

52
00:03:06,540 --> 00:03:09,950
And it's not going to execute the lines of code after this statement.

53
00:03:09,960 --> 00:03:16,980
As you can see here and if I if I want to actually execute city AT&amp;T that case here I need to click

54
00:03:16,980 --> 00:03:18,730
on that delete button once again.

55
00:03:18,800 --> 00:03:19,350
OK.

56
00:03:19,500 --> 00:03:21,720
So that's the meaning of return here.

57
00:03:21,750 --> 00:03:26,250
All told you about this written statement in the previous tutorial.

58
00:03:26,550 --> 00:03:28,350
And here we have this break statement.

59
00:03:28,350 --> 00:03:28,810
OK.

60
00:03:28,980 --> 00:03:34,040
So after this switch statement here as you can see we have the switch statement here.

61
00:03:34,050 --> 00:03:34,830
Right.

62
00:03:34,860 --> 00:03:35,700
So this is the kernel.

63
00:03:35,730 --> 00:03:39,530
These are the curly braces that are related to the switch statement.

64
00:03:39,540 --> 00:03:46,930
So after this three statement I can just refer to the name of this adapter object Dadds notify data

65
00:03:47,160 --> 00:03:48,260
set change.

66
00:03:48,540 --> 00:03:54,390
So this method is not if I said change is going to actually let the adapter know that we want to actually

67
00:03:55,180 --> 00:03:56,890
that the data is actually changed.

68
00:03:56,940 --> 00:03:57,510
OK.

69
00:03:57,750 --> 00:04:03,690
And it's going to update itself and it's going to actually show the updated values inside our list view.

70
00:04:03,690 --> 00:04:09,840
So if it is going to update the list view so that we can actually see the updated values for example

71
00:04:09,840 --> 00:04:16,890
if we use the phrase as an object into the database and it's that object is going to be for example

72
00:04:16,920 --> 00:04:22,950
added to the computer's name at a we need to call the Smurfette in order to see that object inside our

73
00:04:22,950 --> 00:04:24,330
list view otherwise.

74
00:04:24,360 --> 00:04:28,380
And if we don't call this method here is it after that notify changed.

75
00:04:28,440 --> 00:04:33,450
If it is not going I should update the list view and bitch and we would be not and we would not be able

76
00:04:33,450 --> 00:04:38,540
to actually see the object to see the added objects or the deleted objects.

77
00:04:38,550 --> 00:04:45,180
So this is very important that you actually put this piece of code here and after that notify data set

78
00:04:45,180 --> 00:04:45,680
changed.

79
00:04:45,690 --> 00:04:46,460
OK.

80
00:04:46,830 --> 00:04:51,570
So hopefully that makes sense so remember that here I put this piece of quote He had this line of quote

81
00:04:51,570 --> 00:04:54,100
he had inside this uncle for as you can see here.

82
00:04:54,270 --> 00:04:55,020
OK.

83
00:04:55,380 --> 00:04:57,000
So hopefully that makes sense.

84
00:04:57,030 --> 00:04:59,910
And now let's actually on our project and see what happens.

85
00:05:00,070 --> 00:05:05,680
So as you can see here our application is running on this emulator here and here as you can see we have

86
00:05:05,680 --> 00:05:08,850
these editrix see that and we have this at the bottom.

87
00:05:08,860 --> 00:05:09,910
And this delete button.

88
00:05:10,030 --> 00:05:13,850
So analysis actually assign a value for these computer name.

89
00:05:13,990 --> 00:05:17,470
So for the computer name I can just typing a match.

90
00:05:17,990 --> 00:05:25,490
And for the computer type I can just typing a desktop desktop computer.

91
00:05:26,230 --> 00:05:26,730
OK.

92
00:05:26,890 --> 00:05:29,830
And then here if I click on this add what's in here.

93
00:05:29,830 --> 00:05:33,710
Now as you can see this value is going to be added to our list view.

94
00:05:33,730 --> 00:05:37,220
I imagine Dasch desktop computer right.

95
00:05:37,270 --> 00:05:41,210
And if I click on this delete button here that's value is going to be deleted.

96
00:05:41,230 --> 00:05:47,410
So that may actually at that's about you again here you match and of for the computer type computer

97
00:05:47,500 --> 00:05:48,770
or this computer is.

98
00:05:48,820 --> 00:05:49,340
Excuse me.

99
00:05:49,360 --> 00:05:53,230
Desktop computer.

100
00:05:53,620 --> 00:05:55,000
And then click on Add.

101
00:05:55,480 --> 00:05:59,370
And again I want to actually add an order of audio for the computer name.

102
00:05:59,440 --> 00:06:10,220
So iPhone for example iPhone 7 and for the computer type I can just type in our mobile computer mobile

103
00:06:10,750 --> 00:06:17,560
computer and then if I click on this button here it's going to add value to our list view and for the

104
00:06:17,560 --> 00:06:18,230
computer.

105
00:06:18,300 --> 00:06:27,210
Again I want to add another value for example galaxy galaxy is six.

106
00:06:27,710 --> 00:06:35,610
And for the computer type I can just type in a more wide more wide computer.

107
00:06:36,190 --> 00:06:41,770
And here if I click on this and put in here that value is going to be added to Odlyzko view right.

108
00:06:41,770 --> 00:06:46,870
So now you can actually click on dispatch button here and if you actually click on these background

109
00:06:47,110 --> 00:06:51,340
applications and if I actually close this application now.

110
00:06:51,490 --> 00:06:58,530
Now if I open this application again here at 58 now here as you can see these data are actually deceived.

111
00:06:58,680 --> 00:06:59,180
OK.

112
00:06:59,280 --> 00:07:05,520
I actually added these data to my database and those that are actually being retrieved from the database

113
00:07:06,030 --> 00:07:07,080
and I can see those data.

114
00:07:07,080 --> 00:07:09,640
So those they thought actually saved inside the database.

115
00:07:09,990 --> 00:07:16,560
And if it's for example one of them and here for example I deleted all the computer artex and this one

116
00:07:16,560 --> 00:07:17,270
remains.

117
00:07:17,400 --> 00:07:23,370
And if I click on dispatch button here or if I actually close this application here completely and if

118
00:07:23,370 --> 00:07:25,650
I open the application again here.

119
00:07:25,710 --> 00:07:31,920
Now as you can see here this data is actually saved and those data that I actually deleted a few seconds

120
00:07:31,920 --> 00:07:33,850
ago are actually gone.

121
00:07:33,870 --> 00:07:34,340
OK.

122
00:07:34,470 --> 00:07:37,530
Those They are not here we just can't see the value here.

123
00:07:37,560 --> 00:07:38,400
OK.

124
00:07:38,880 --> 00:07:45,360
And in this way you can actually save your data or delete data from the database here as you can see

125
00:07:45,360 --> 00:07:50,950
in say this is your LATE handler class I actually added some other methods for example updates computer.

126
00:07:51,300 --> 00:07:56,850
You can use this method in order to update a specific item inside your list view.

127
00:07:56,920 --> 00:07:57,170
OK.

128
00:07:57,310 --> 00:08:01,780
Or for example get computers count or other methods.

129
00:08:01,800 --> 00:08:04,110
So this is how you can work with as too late.

130
00:08:04,110 --> 00:08:10,940
So for now just make sure that you actually learn all these concepts that taught you are in this tutorial.

131
00:08:11,000 --> 00:08:15,900
Please if you have any questions please post the discussion in the course and then I'll do my best to

132
00:08:15,900 --> 00:08:17,430
answer all of your questions.

133
00:08:17,490 --> 00:08:18,840
Thank you very much for watching.

134
00:08:18,870 --> 00:08:20,410
And I've seen the next tutorial.

