1
00:00:00,960 --> 00:00:05,530
And here inside the unclick Meffert I can just put in some lines of code here.

2
00:00:06,000 --> 00:00:14,370
So first of all this actually creates a new class so just click on View tool windows and then a project

3
00:00:15,200 --> 00:00:18,380
an inside job or folder here you can see this is our package.

4
00:00:18,450 --> 00:00:19,120
OK.

5
00:00:19,380 --> 00:00:26,800
And now I want to actually create another activity class for my second Underland activity that.

6
00:00:26,820 --> 00:00:27,440
OK.

7
00:00:27,660 --> 00:00:33,570
So every exemplify as you can see here needs to have an activity activity activity class.

8
00:00:33,990 --> 00:00:39,970
And here I want to actually create an activity for this second underline activity that is similar.

9
00:00:39,990 --> 00:00:42,630
So here I just need to right click on this package here.

10
00:00:42,790 --> 00:00:52,690
OK new and then click on dhaba class and for the class name just type in here.

11
00:00:52,760 --> 00:01:02,530
Second activity Okay now as you can see this is our second activity class and because if you want to

12
00:01:02,530 --> 00:01:08,140
actually create an activity here I just enjoy taking extends activity.

13
00:01:08,410 --> 00:01:08,830
OK.

14
00:01:08,890 --> 00:01:10,940
As you can see here this is our activity class.

15
00:01:10,960 --> 00:01:11,400
OK.

16
00:01:11,630 --> 00:01:18,550
Or I can even inherit from this Abqaiq are compact activity which I should in indirectly inherits from

17
00:01:18,560 --> 00:01:23,460
these all of the features and behaviors that are inside of the activity class.

18
00:01:23,470 --> 00:01:29,590
So inside the second activity class instead of just referring to the name of this activity class I can

19
00:01:29,590 --> 00:01:33,040
just open up compact activity OK.

20
00:01:33,430 --> 00:01:39,430
And this is better because in this way we are going to inherit lots and lots of methods from those classes

21
00:01:39,430 --> 00:01:42,930
that we actually inherit directly or indirectly.

22
00:01:43,200 --> 00:01:43,750
OK.

23
00:01:44,050 --> 00:01:50,830
So first of all inside of this class I need to actually override the uncreate method that we actually

24
00:01:51,160 --> 00:01:54,240
inherit from the superclass.

25
00:01:54,250 --> 00:02:01,660
So uncreate OK I just need to select this uncreate and for that you can see here on create save instance

26
00:02:02,050 --> 00:02:03,160
state.

27
00:02:03,160 --> 00:02:05,460
So as you can see here this is our uncreate method.

28
00:02:05,470 --> 00:02:06,070
OK.

29
00:02:06,310 --> 00:02:11,380
And here as you can see it is calling this on creating an effect on these superclass.

30
00:02:11,540 --> 00:02:21,500
OK and now let's actually called the set set content view here said content view Meffert and then select

31
00:02:21,520 --> 00:02:23,400
does it here sent content for you.

32
00:02:23,410 --> 00:02:28,680
And as you can see here it accepts an argument of type integer layout raise ID.

33
00:02:28,990 --> 00:02:29,510
OK.

34
00:02:29,770 --> 00:02:34,270
And here we need to actually be fair to the name of our ID inside of these.

35
00:02:34,400 --> 00:02:42,870
So you have to lay out that ok or dot lay out that section I underline activity.

36
00:02:43,530 --> 00:02:44,020
OK.

37
00:02:44,170 --> 00:02:48,190
So in this way it can actually initialize the second activity exemplified.

38
00:02:48,220 --> 00:02:48,810
OK.

39
00:02:48,970 --> 00:02:52,320
So so that we can actually see this file on the screen.

40
00:02:52,440 --> 00:02:53,350
OK.

41
00:02:53,620 --> 00:02:54,540
And now.

42
00:02:54,550 --> 00:02:58,800
So now let's actually go back inside these main activity the double file here.

43
00:02:58,900 --> 00:03:01,800
And now let's actually put putting some more lines of code here.

44
00:03:01,900 --> 00:03:06,820
Here I want to actually put in some lines of code in order to let use.

45
00:03:07,090 --> 00:03:13,240
If the user click on the spot in there and actually guide it to the second screen which is the second

46
00:03:13,240 --> 00:03:14,120
activity here.

47
00:03:14,200 --> 00:03:14,810
OK.

48
00:03:15,310 --> 00:03:21,200
So now inside of this enclave if at first about I need to actually create an intent object.

49
00:03:21,220 --> 00:03:21,700
OK.

50
00:03:21,880 --> 00:03:28,830
And intent is actually a class that allows us to actually go from one activity to another activity.

51
00:03:28,840 --> 00:03:29,260
OK.

52
00:03:29,380 --> 00:03:32,980
So intent intent that the name of our object is intent.

53
00:03:32,980 --> 00:03:37,510
Assignment operator new intent.

54
00:03:37,510 --> 00:03:40,060
So here I actually created an object of type intent.

55
00:03:40,190 --> 00:03:40,390
OK.

56
00:03:40,480 --> 00:03:46,000
And the name of this object is intent and this object actually allows us to go from one activity to

57
00:03:46,000 --> 00:03:46,780
another activity.

58
00:03:46,780 --> 00:03:47,360
OK.

59
00:03:47,740 --> 00:03:53,360
So here I can just type in intent that sets class.

60
00:03:53,620 --> 00:03:54,310
OK.

61
00:03:54,730 --> 00:03:59,980
So this method actually to accepts two arguments the first argument is actually the source class the

62
00:03:59,980 --> 00:04:00,660
first class.

63
00:04:00,680 --> 00:04:05,520
The second argument is the destination classic class that is actually our target.

64
00:04:05,710 --> 00:04:06,110
OK.

65
00:04:06,130 --> 00:04:07,870
The first class is the main activity.

66
00:04:07,870 --> 00:04:08,310
OK.

67
00:04:08,440 --> 00:04:15,080
So here I just need to type in this comma and the second class is the second activity.

68
00:04:15,080 --> 00:04:19,910
OK so the second activity is this second activity as you can see here.

69
00:04:19,960 --> 00:04:27,490
So I can't just say insurgent activity that class and then I need to put in a semicolon at the end of

70
00:04:27,490 --> 00:04:28,760
my statement here.

71
00:04:29,300 --> 00:04:33,660
And now I need to actually the column effect from the from the activity class.

72
00:04:33,760 --> 00:04:34,300
OK.

73
00:04:34,420 --> 00:04:38,980
So here we are actually inheriting all of the features and behaviors that are inside of this activity

74
00:04:38,980 --> 00:04:39,280
class.

75
00:04:39,280 --> 00:04:39,890
OK.

76
00:04:40,120 --> 00:04:43,520
So I can just typing start activity.

77
00:04:43,660 --> 00:04:47,130
So this activity Meffert actually accepts an argument of type intent.

78
00:04:47,140 --> 00:04:50,020
So here I can just refer to the name of this object.

79
00:04:50,040 --> 00:04:52,820
Intent OK.

80
00:04:53,240 --> 00:04:56,720
And now let's actually run our project and see what happens.

81
00:04:56,800 --> 00:05:02,530
So as you can see here our application is running on this emulator and this is our first activity.

82
00:05:02,650 --> 00:05:03,970
OK.

83
00:05:03,970 --> 00:05:07,740
And this is our source class and we want to actually move on to the next activity.

84
00:05:07,750 --> 00:05:08,330
OK.

85
00:05:08,590 --> 00:05:10,530
So here I just need to click on this.

86
00:05:10,540 --> 00:05:13,250
Let's go to second activity OK.

87
00:05:13,330 --> 00:05:14,670
So let's click on this.

88
00:05:14,940 --> 00:05:17,570
And now as you can see our application crashed.

89
00:05:17,920 --> 00:05:22,010
Let's actually go inside this lock here and see what's the cause of this error.

90
00:05:22,240 --> 00:05:29,280
And here as you can see it says how do you declare this activity in your Android manifest that XML.

91
00:05:29,290 --> 00:05:33,130
So let's see what's the advertisement manifested exemplified.

92
00:05:33,130 --> 00:05:40,060
So let's actually click on this view here to the windows project and here as you can see we have a manifest

93
00:05:40,060 --> 00:05:40,810
folder here.

94
00:05:40,840 --> 00:05:42,030
OK.

95
00:05:42,040 --> 00:05:47,410
And inside of this manifest folder there is there is a file called Android manifesto examine and this

96
00:05:47,410 --> 00:05:49,800
is our Android manifesto exemplified.

97
00:05:50,110 --> 00:05:55,630
And as you can see here inside of this manifest take as you can see there are some lines of code here

98
00:05:55,810 --> 00:05:57,990
and we have this application here.

99
00:05:58,230 --> 00:05:59,210
OK.

100
00:05:59,430 --> 00:06:04,040
Application tag and inside of this application tag we have this activity.

101
00:06:04,110 --> 00:06:04,470
OK.

102
00:06:04,500 --> 00:06:10,110
So here as you can see this is the activity attack and inside of this activity tag as you can see it

103
00:06:10,110 --> 00:06:13,000
says Android name dot main activity.

104
00:06:13,270 --> 00:06:19,360
So does that mean activity refers to this main activity class as he can see inside of this package.

105
00:06:19,470 --> 00:06:21,560
Ok this is our own package.

106
00:06:21,600 --> 00:06:27,190
So if I actually declare another class inside another package I need to actually first of all refer

107
00:06:27,190 --> 00:06:31,330
to the name of that package and then I need to refer to the name of that class.

108
00:06:31,440 --> 00:06:34,680
But here we don't need to refer to the name of this package.

109
00:06:34,770 --> 00:06:41,070
Just putting dots here is enough so that main activity refers to the name of this class inside of this

110
00:06:41,070 --> 00:06:41,910
package.

111
00:06:42,300 --> 00:06:49,920
And here we have Android label as you can see here and here as you can see it says Android app frailty.

112
00:06:50,060 --> 00:06:56,010
OK this is the label of our application app for flirty which you can see at the top of the email emulator

113
00:06:56,550 --> 00:06:56,720
app.

114
00:06:56,730 --> 00:07:00,020
Firstly And this is the theme of our application.

115
00:07:00,030 --> 00:07:03,570
So at sign the style slash apophenia does no action bar.

116
00:07:03,830 --> 00:07:04,230
OK.

117
00:07:04,290 --> 00:07:06,740
So I'll talk more about these values later.

118
00:07:07,050 --> 00:07:11,080
But here as you can see it says intent dasht fruiterer.

119
00:07:11,270 --> 00:07:11,850
OK.

120
00:07:12,240 --> 00:07:17,880
So here for the first time that application is actually running we need to actually specify the activity

121
00:07:17,880 --> 00:07:21,830
the first activity the entry point of activity inside is.

122
00:07:21,870 --> 00:07:26,190
And like manifests for the entry point of our application is this main activity.

123
00:07:26,200 --> 00:07:26,860
OK.

124
00:07:27,160 --> 00:07:28,740
Activity underline me.

125
00:07:29,150 --> 00:07:29,930
OK.

126
00:07:29,970 --> 00:07:38,280
So here we need to specify that we want to actually first of all run when we want to show the the activity

127
00:07:38,280 --> 00:07:39,870
Underland mean that exemption to the user.

128
00:07:39,900 --> 00:07:40,260
OK.

129
00:07:40,380 --> 00:07:46,050
So first what that are laid out is the entry point for our application.

130
00:07:46,050 --> 00:07:54,150
So here inside this intent dash filters tag as you can see here it says Android that intense that action

131
00:07:54,150 --> 00:07:54,890
that main.

132
00:07:55,030 --> 00:07:57,920
OK we have two takes action and category.

133
00:07:58,170 --> 00:08:02,110
And here it says Android that intent the chatter luncher.

134
00:08:02,460 --> 00:08:07,850
OK so the activity underline minute example is the lantern over application.

135
00:08:08,000 --> 00:08:08,360
OK.

136
00:08:08,370 --> 00:08:13,470
So here after the ending tag of this activity here I want to actually create another activity for the

137
00:08:13,470 --> 00:08:14,550
second activity.

138
00:08:14,750 --> 00:08:19,490
So inside of this application tag all you want to create another attack here.

139
00:08:19,580 --> 00:08:20,190
OK.

140
00:08:20,340 --> 00:08:25,120
So after this activity here I can't just create another activity.

141
00:08:25,200 --> 00:08:29,300
So after this activity tag I can't just create another activity here.

142
00:08:29,310 --> 00:08:35,630
So just open this tag here activity and then press enter key on your keyboard.

143
00:08:35,640 --> 00:08:41,700
So here as you can see inside of these double quotes it says second activity or that main activity here

144
00:08:41,730 --> 00:08:44,540
I can choose this second activity OK.

145
00:08:44,610 --> 00:08:48,750
And then here I can actually specify the label.

146
00:08:48,780 --> 00:08:49,120
OK.

147
00:08:49,140 --> 00:08:55,430
So here I can just type in label and then present into the key on your keyboard and inside the double

148
00:08:55,440 --> 00:08:55,860
quotes.

149
00:08:55,860 --> 00:08:59,610
I can just type insurgent activity.

150
00:09:00,270 --> 00:09:00,660
OK.

151
00:09:00,720 --> 00:09:05,540
I can even specify the theme of my activity so Feme.

152
00:09:06,330 --> 00:09:11,590
And here I can choose this screen here at Slate and slide slash and Feme does no action.

153
00:09:11,870 --> 00:09:12,530
OK.

154
00:09:12,840 --> 00:09:17,510
And then here I need to actually close the stack here or Katis activity take.

155
00:09:17,580 --> 00:09:20,610
So just I just need to put in a closing tag here.

156
00:09:21,000 --> 00:09:25,410
And as you can see here we can see this activity tag here.

157
00:09:25,410 --> 00:09:29,760
So this is our activity tag that we actually putting in after this tag here.

158
00:09:29,880 --> 00:09:31,760
And inside of this application.

159
00:09:31,830 --> 00:09:32,370
OK.

160
00:09:32,610 --> 00:09:38,620
So activity and right name the second activity Android label second activity and Rufin.

161
00:09:38,910 --> 00:09:40,300
I feel that no action.

162
00:09:40,380 --> 00:09:43,050
OK so now let's actually run our project.

163
00:09:43,050 --> 00:09:49,770
So again as you can see our application is running on this emulator and it says this is our first activity.

164
00:09:49,920 --> 00:09:50,610
Okay.

165
00:09:50,850 --> 00:09:57,220
And now I want to actually click on this button here that says let's go to second activity.

166
00:09:57,630 --> 00:10:01,080
And now as you can see this is our second activity here.

167
00:10:01,400 --> 00:10:01,690
OK.

