1
00:00:00,720 --> 00:00:03,710
So let's actually do it on our project and see what happens.

2
00:00:03,930 --> 00:00:11,100
So now as you can see our application is running on this emulator and we have this tab on here and we

3
00:00:11,100 --> 00:00:16,890
have this I have to Celeste's Let's actually select this tab to here and we have nothing inside this

4
00:00:16,890 --> 00:00:17,790
tab.

5
00:00:17,910 --> 00:00:20,830
So let's actually open our activity on the length socket.

6
00:00:20,840 --> 00:00:23,300
On second underline tablet example.

7
00:00:23,650 --> 00:00:27,640
And now let's actually change the theme of this XML file.

8
00:00:27,810 --> 00:00:36,060
So just click on this app fame and material light and choose the second one material that lights the

9
00:00:36,330 --> 00:00:44,030
action bar and lets actually drag a large text view here and just type click on it.

10
00:00:44,040 --> 00:00:47,330
And for the text just typing here.

11
00:00:47,400 --> 00:00:49,940
Second activity.

12
00:00:50,400 --> 00:00:52,610
And then press Enter key on your keyboard.

13
00:00:52,830 --> 00:00:55,850
So let's actually run our project again and see what happens.

14
00:00:55,890 --> 00:01:00,250
So now as you can see our application is running on this emulator.

15
00:01:00,300 --> 00:01:06,100
So let's actually select this tab to here and here we can see this second activity here.

16
00:01:06,240 --> 00:01:08,580
So hopefully that makes sense.

17
00:01:08,620 --> 00:01:11,650
And now let's actually go back to what the main activity that you will find here.

18
00:01:11,680 --> 00:01:14,760
Let's actually add another tap to our application.

19
00:01:14,760 --> 00:01:19,260
So now I'm going to actually pasting some more lines of code here and then I'm going to explain to you

20
00:01:19,260 --> 00:01:20,720
what's going on here.

21
00:01:21,090 --> 00:01:25,100
So as you can see here these are the lines of code that I pasted here.

22
00:01:25,230 --> 00:01:31,430
And as you can see again I'll refer to the name of this spek object assignment operator tab host that

23
00:01:31,440 --> 00:01:34,870
new tab spec and this is going to be the tag.

24
00:01:34,950 --> 00:01:36,070
OK free.

25
00:01:36,510 --> 00:01:40,180
So now I have actually this line of code here in line 42.

26
00:01:40,180 --> 00:01:47,260
You referred to this to the name of this spec object that set indicator top free as you can see here.

27
00:01:48,190 --> 00:01:50,080
And we have this free as a tag.

28
00:01:50,080 --> 00:01:50,690
OK.

29
00:01:51,010 --> 00:01:58,650
And in line free I have this intense object intent for the new intense main activity that this and first

30
00:01:58,650 --> 00:02:00,410
tap activity that class.

31
00:02:00,460 --> 00:02:03,300
So we don't have this forever type activity class yet.

32
00:02:03,400 --> 00:02:10,060
We're going to create it in a minute and in line 44 I actually referred to the name of this spec object

33
00:02:10,330 --> 00:02:15,020
spec that said content intent free and inline 44.

34
00:02:15,040 --> 00:02:20,240
I added this tab to this tab host top host that at top spec.

35
00:02:20,710 --> 00:02:24,670
So now let's actually create a fresh activity in our project.

36
00:02:24,700 --> 00:02:35,760
I just need to click on this package here and then click on File new activity empty activity and for

37
00:02:35,760 --> 00:02:43,050
the name of our activity I can't just type in ferde tap activity.

38
00:02:44,150 --> 00:02:50,460
And here just click on finish and now as you can see we have this activity and in our main activity

39
00:02:50,460 --> 00:02:52,830
class now the error is gone.

40
00:02:52,830 --> 00:02:59,450
So just click on these first tab activity here that example just click on this activity underline the

41
00:03:00,060 --> 00:03:01,690
underlined tab that examen.

42
00:03:01,710 --> 00:03:05,020
So let's change the theme of this exemplify.

43
00:03:05,190 --> 00:03:15,190
So Feme material light and material that light that dot action dodge action bar OK and then click on

44
00:03:15,210 --> 00:03:16,640
OK.

45
00:03:16,830 --> 00:03:23,900
Now let's actually drag a large text view here and double click on it for the text just typing here.

46
00:03:23,920 --> 00:03:26,440
Fair activity.

47
00:03:27,930 --> 00:03:30,030
And then person enter key on your keyboard.

48
00:03:30,030 --> 00:03:34,560
So now let's actually run our project and see what happens.

49
00:03:34,560 --> 00:03:42,600
So here as you can see our application is running on this emulator and we have this tab 1 tab 2 and

50
00:03:42,600 --> 00:03:43,630
tab free.

51
00:03:43,860 --> 00:03:44,820
OK.

52
00:03:45,180 --> 00:03:50,430
So this is how you can actually create a tab application in your project.

53
00:03:50,460 --> 00:03:55,720
And I think that's enough for this kind of Paphos.

54
00:03:55,740 --> 00:04:03,830
But I think we can actually create another tab host in our project so actually create and.

55
00:04:04,100 --> 00:04:04,960
Lay out fine.

56
00:04:04,980 --> 00:04:11,550
So just like we can lay out fine here and in New and then lay out resource wide Okay.

57
00:04:11,700 --> 00:04:19,320
So for the name of your resource file just typing here and other you need to actually write your filenames

58
00:04:19,320 --> 00:04:21,590
your filenames in lowercase.

59
00:04:21,650 --> 00:04:29,550
OK another type I know there's type post.

60
00:04:29,770 --> 00:04:30,410
OK.

61
00:04:30,760 --> 00:04:36,060
And for the root element choose a relative lay out OK and source said Main.

62
00:04:36,090 --> 00:04:36,900
Well that's OK.

63
00:04:36,970 --> 00:04:39,170
And for the directory name out.

64
00:04:39,250 --> 00:04:39,720
OK.

65
00:04:39,880 --> 00:04:40,620
And then click on.

66
00:04:40,630 --> 00:04:41,470
OK.

67
00:04:42,100 --> 00:04:45,470
So we have this and other type host.

68
00:04:45,580 --> 00:04:49,880
Now our list actually to change the theme of this XML file.

69
00:04:49,990 --> 00:04:57,130
So just to click on app Feme material light material that light that dark action mode.

70
00:04:57,190 --> 00:05:02,400
So now it's actually double click on this and either underline top that underline host that example

71
00:05:02,410 --> 00:05:03,110
here.

72
00:05:03,310 --> 00:05:08,110
And I want to actually drag a tab host into this relatively out here.

73
00:05:08,110 --> 00:05:12,630
So inside these containers folder if you have these tab host widget here.

74
00:05:12,640 --> 00:05:13,040
OK.

75
00:05:13,120 --> 00:05:17,620
So just select it and put it here at the center of this relatively out.

76
00:05:17,890 --> 00:05:22,460
And as you can see here we have this tab host here inside this componentry section.

77
00:05:22,870 --> 00:05:25,850
And now as you can see we have these free linearly.

78
00:05:25,900 --> 00:05:29,060
This time I don't want to delete this linearly out.

79
00:05:29,200 --> 00:05:29,750
OK.

80
00:05:29,980 --> 00:05:36,670
So let's actually go inside our Takes here takes tap and here and as you can see we have these linear

81
00:05:36,670 --> 00:05:38,580
layouts inside this frame layer.

82
00:05:38,590 --> 00:05:39,330
OK.

83
00:05:39,670 --> 00:05:45,150
So now I want to actually add some more components inside these linearly outs.

84
00:05:45,160 --> 00:05:51,220
For example first of all I want to change the background color of these linearly else so I can just

85
00:05:51,220 --> 00:05:59,080
type in background and I can just typing in for example I can just select this assigned color here and

86
00:05:59,080 --> 00:06:04,220
then here I can just hold the control key and then present the space key on my keyboard.

87
00:06:04,420 --> 00:06:06,700
And here we have these three colors here.

88
00:06:06,700 --> 00:06:07,270
OK.

89
00:06:07,450 --> 00:06:14,410
So for the first tab I want to choose this color primary and for this linearly out as you can see here.

90
00:06:14,650 --> 00:06:18,370
Again I want to change the background color of this linearly out.

91
00:06:18,370 --> 00:06:26,980
So here I can just type in background color and I just need to hold the control key on my keyboard and

92
00:06:26,980 --> 00:06:28,470
then press on the space.

93
00:06:28,630 --> 00:06:35,030
And here this time choose colored accent and again I want to change the background color of this linear

94
00:06:35,040 --> 00:06:35,340
layer.

95
00:06:35,380 --> 00:06:35,890
OK.

96
00:06:35,990 --> 00:06:43,160
So I can't just type in background and selected and color and hold the control key on my keyboard.

97
00:06:43,160 --> 00:06:47,240
And here this time I want to choose this color primary Dortch.

98
00:06:47,840 --> 00:06:53,960
So here I actually to change the background colors of these linear layouts here.

99
00:06:54,050 --> 00:06:58,260
As you can see here the back end of these linearly else that are inside of this frame.

100
00:06:58,310 --> 00:06:59,070
OK.

101
00:06:59,720 --> 00:07:06,300
So remember that I actually didn't delete these linear layouts here for this kind of exemplify.

102
00:07:06,350 --> 00:07:06,910
OK.

103
00:07:07,010 --> 00:07:08,150
Because in this.

104
00:07:08,360 --> 00:07:13,530
Now I want to actually show you how you can create your host in an other way.

105
00:07:13,610 --> 00:07:14,230
OK.

106
00:07:14,630 --> 00:07:18,940
So now I want to actually put a text view inside these linearly outs.

107
00:07:18,950 --> 00:07:19,370
OK.

108
00:07:19,490 --> 00:07:26,360
So for this linearly out here inside this linearly out as you can see this is the starting linearly

109
00:07:26,360 --> 00:07:32,150
out and this is the ending of this linearly other case so inside this linear linearly out all you want

110
00:07:32,150 --> 00:07:33,870
to create a text view.

111
00:07:33,890 --> 00:07:41,190
So just open a takes text view and for the layout Veith just assign the value match parent.

112
00:07:41,420 --> 00:07:44,500
And for the layout height assigned the value wrap content.

113
00:07:44,720 --> 00:07:49,820
And it's actually add another attribute text for the text just type in here.

114
00:07:49,820 --> 00:07:54,880
This is our first tap.

115
00:07:55,120 --> 00:07:55,850
OK.

116
00:07:56,230 --> 00:08:01,110
And again for this Secondly nearly out insight this linearly out here.

117
00:08:01,120 --> 00:08:03,230
Again I want to create another text view.

118
00:08:03,310 --> 00:08:09,910
So just open a tag selected for the out which is saying the value match parent for the layout height

119
00:08:09,940 --> 00:08:11,870
assigning the value or content.

120
00:08:12,160 --> 00:08:23,250
And for the text attributes just typing here this is secant second tap.

121
00:08:23,750 --> 00:08:26,110
And again we have another linearly out.

122
00:08:26,120 --> 00:08:32,650
So in Enceladus linearly or here again I want to create another text view for the layout which assigned

123
00:08:32,650 --> 00:08:42,500
a value match parent for the layout height assign the value or content and for the text attributes assigned

124
00:08:42,510 --> 00:08:43,090
the value.

125
00:08:43,090 --> 00:08:47,100
This is first tap.

126
00:08:47,390 --> 00:08:54,180
OK so I have this ACAP host inside our user interface as you can see here.

127
00:08:54,320 --> 00:09:01,140
And as you can see I actually changed the background color of these linear layouts.

128
00:09:01,190 --> 00:09:07,550
So now let's actually create a java file that is going to be related to this exemplified another type

129
00:09:07,550 --> 00:09:07,920
host.

130
00:09:07,940 --> 00:09:08,450
OK.

131
00:09:08,870 --> 00:09:14,420
So here in order to do that in our project structure I just need to select this package here and then

132
00:09:14,510 --> 00:09:21,890
I just need to right click on this package new and then select this Java class and for the name of your

133
00:09:21,890 --> 00:09:25,050
activity you can just typing activity.

134
00:09:25,340 --> 00:09:27,840
Or you can just typing in another

135
00:09:30,910 --> 00:09:41,020
type host OK activity and other type hosts activity and then click on OK.

136
00:09:41,170 --> 00:09:43,320
So this is going to be our class.

137
00:09:43,450 --> 00:09:51,920
So this class is going to be inheriting all of the features and behaviors of the of the outcome productivity.

138
00:09:52,040 --> 00:09:52,580
OK.

139
00:09:52,600 --> 00:09:56,770
Like all our classes in our Android applications that we created so far.

140
00:09:56,880 --> 00:09:57,180
OK.

141
00:09:57,190 --> 00:10:03,090
So this time I don't want to inherit all of the features and behaviors of the activity group or kids

142
00:10:03,160 --> 00:10:06,550
as we did inside this main activity that will fight here.

143
00:10:06,550 --> 00:10:12,260
Are you going to actually inherit from this accompted activity and now I need to actually overwrite

144
00:10:12,260 --> 00:10:15,480
the uncreate method and create method.

145
00:10:15,520 --> 00:10:22,690
And then as you can see here I just need to select this uncreate method that actually accepts this argument

146
00:10:22,700 --> 00:10:27,370
to save instance state and then press enter key on my keyboard.

147
00:10:27,400 --> 00:10:29,710
So this is our uncreate method.

148
00:10:29,970 --> 00:10:37,320
And now I need to actually call the set content view method on this uncreate method inside is and create

149
00:10:37,360 --> 00:10:37,970
Meffert.

150
00:10:37,990 --> 00:10:41,040
So here I can just type in sets content's view.

151
00:10:41,500 --> 00:10:48,670
And here I can just type in our thoughts lay layout dots as you can see here we can actually choose

152
00:10:48,970 --> 00:10:52,580
or exemplifies that we created in our lay out there.

153
00:10:52,780 --> 00:10:57,100
So here I have this activity type host.

154
00:10:57,160 --> 00:11:02,100
So here I have this and another type host here this XML file.

155
00:11:02,110 --> 00:11:03,760
So I just need to select it.

156
00:11:04,030 --> 00:11:11,410
So it is going to actually load up this XML file when we actually are going to actually open this activity.

157
00:11:11,410 --> 00:11:11,920
OK.

158
00:11:12,010 --> 00:11:17,320
So this XML file is going to be related only to this and others type hosts activity.

159
00:11:17,320 --> 00:11:17,740
OK.

160
00:11:17,800 --> 00:11:22,450
So now when I actually paste in some lines of code here and then I'm going to explain to you what's

161
00:11:22,450 --> 00:11:23,490
going on here.

162
00:11:23,500 --> 00:11:27,730
So as you can see here these are the lines of code that I actually pasted here.

163
00:11:27,910 --> 00:11:34,480
Tab host and the name of my object is host assignment operator and here as you can see I am actually

164
00:11:34,480 --> 00:11:42,580
casting this object way to a tab host object find view by ID or that ID that tab host.

165
00:11:42,620 --> 00:11:51,140
OK so now so as you can see here because we have this I-T we have this ID twice in our project.

166
00:11:51,160 --> 00:11:51,420
OK.

167
00:11:51,430 --> 00:11:58,800
Once in our main activity class we actually use this ID and here are another type hostes activity.

168
00:11:58,870 --> 00:12:00,430
Again we are using this idea.

169
00:12:00,610 --> 00:12:04,080
It's better to change this ID to another ID.

170
00:12:04,120 --> 00:12:09,530
So insight are another underlying top Underland host that the example I just need to select is to have

171
00:12:09,530 --> 00:12:16,200
host to here and here as you can see the idea of this tab host is Paphos to.

172
00:12:16,240 --> 00:12:16,960
OK.

173
00:12:16,960 --> 00:12:23,430
So in our and others type hosts activity that job file here I just need to change it to tap host to.

174
00:12:23,700 --> 00:12:24,200
OK.

175
00:12:24,370 --> 00:12:27,740
So it's going to actually use that specific tap host.

176
00:12:28,390 --> 00:12:31,600
And here I just actually get that object.

177
00:12:31,600 --> 00:12:38,020
And here again I actually referred to the name of this object host that set up so it can actually set

178
00:12:38,020 --> 00:12:40,210
up that tab host for us.

179
00:12:40,300 --> 00:12:41,030
OK.

180
00:12:41,320 --> 00:12:45,280
And here I am when I actually pasting some more lines of code here and then I'm going explain to you

181
00:12:45,280 --> 00:12:46,470
what's going on here.

182
00:12:46,480 --> 00:12:52,110
So as you can see here these are the lines of code that I actually pasted here.

183
00:12:52,390 --> 00:12:53,080
OK.

184
00:12:53,290 --> 00:12:56,480
So first of all of you have this tab on here.

185
00:12:56,500 --> 00:12:59,620
Tab host tab spech spake.

186
00:12:59,620 --> 00:13:06,790
So here I am actually creating an object of type tap's pitch and the name of this object is spech assignment

187
00:13:06,850 --> 00:13:07,750
operator.

188
00:13:07,840 --> 00:13:10,400
Post the New Tab spec tab.

189
00:13:10,440 --> 00:13:11,000
1.

190
00:13:11,260 --> 00:13:15,590
So this is going to be the task ok for this spec here.

191
00:13:15,670 --> 00:13:22,990
And then here again in line 41 as you can see I referred to the name of this special object that sits

192
00:13:22,990 --> 00:13:23,930
content.

193
00:13:24,040 --> 00:13:24,610
OK.

194
00:13:24,610 --> 00:13:28,030
And inside the practices are that Id tap one.

195
00:13:28,030 --> 00:13:33,650
So here we need to specify that Veach tab which activity is going to be the first tap.

196
00:13:33,820 --> 00:13:39,290
So here I referred to this idea open or another underline type Underland hosted example.

197
00:13:39,340 --> 00:13:46,820
So as you can see here it does a linearly else as you can see are going to be the activities that we

198
00:13:46,820 --> 00:13:49,310
want to actually put inside our taps.

199
00:13:49,330 --> 00:13:53,400
OK so for example this first linearly out here is going to be the first step.

200
00:13:53,560 --> 00:13:59,450
This second linearly out here is going to be the second type and this is fairly linearly out here.

201
00:13:59,450 --> 00:14:01,110
It's going to be the first type.

202
00:14:01,120 --> 00:14:04,440
So just select this first linearly out here.

203
00:14:04,750 --> 00:14:10,060
And as you can see I can actually change the ID of this linear layout.

204
00:14:10,180 --> 00:14:15,250
So as you can see we have this ID attribute that is related to this linear layout.

205
00:14:15,250 --> 00:14:23,200
I just need to select it and delete the ID and I can just type in Tab 1 and then press on energy on

206
00:14:23,200 --> 00:14:31,150
your keyboard and again select the second linearly out here for the ID just type in here tap 2.

207
00:14:31,750 --> 00:14:40,330
Again first linearly out here and delete this default ID and just type in here tab free and press on

208
00:14:40,470 --> 00:14:42,460
key on your keyboard.

209
00:14:42,460 --> 00:14:44,720
And as you can see here the ideas changed.

210
00:14:44,740 --> 00:14:47,160
So let's go back to what another type host activity here.

211
00:14:47,170 --> 00:14:49,120
And now as you can see the error is gone.

212
00:14:49,270 --> 00:14:50,010
OK.

213
00:14:50,410 --> 00:14:58,180
And here in line for 82 amp setting the indicator spec that said indicator of tap 1 post as you can

214
00:14:58,180 --> 00:15:03,340
see here I referred to this host here that is off the top post that at top spec.

215
00:15:03,850 --> 00:15:05,930
And again we have this tap too.

216
00:15:06,280 --> 00:15:06,660
OK.

217
00:15:06,670 --> 00:15:16,330
Spec assignment operator host that new top spec top to spec that said content are that Id have to spec

218
00:15:16,540 --> 00:15:19,100
that said indicator tap tap 2.

219
00:15:19,300 --> 00:15:19,880
OK.

220
00:15:20,110 --> 00:15:26,950
And here in line for 49 I am adding does that have to do is host host that at top spec.

221
00:15:27,490 --> 00:15:33,730
And again here we are actually adding the first top spec assignment operator host that new top spec

222
00:15:34,150 --> 00:15:36,970
tap free spec that said content.

223
00:15:36,970 --> 00:15:44,170
So here I am actually setting the content of this type are that I didn't have free spec that said indicator

224
00:15:44,370 --> 00:15:45,440
tab free.

225
00:15:45,970 --> 00:15:50,920
And here I am actually adding that have to do is host host that tab spec.

226
00:15:51,400 --> 00:15:55,230
So now if we actually run our project let's see what happens.

227
00:15:55,240 --> 00:16:00,140
So here as you can see our application is running on this emulator.

228
00:16:00,400 --> 00:16:07,150
But here there is a problem we cannot see it is another type host activity that we created here but

229
00:16:07,150 --> 00:16:11,490
we are actually seeing this main activity that we actually put our taps here.

230
00:16:11,500 --> 00:16:12,120
OK.

231
00:16:12,280 --> 00:16:16,420
So how we can actually see this and other type of activity.

232
00:16:16,720 --> 00:16:20,500
So the answer is inside these Android manifest FOID.

233
00:16:20,740 --> 00:16:26,290
So here in our Android manifest file I just need to open this and the manifest file.

234
00:16:26,350 --> 00:16:32,980
And here as you can see for this activity tag here as you can see here this is our main main activity

235
00:16:32,980 --> 00:16:33,250
here.

236
00:16:33,250 --> 00:16:33,760
OK.

237
00:16:33,970 --> 00:16:37,450
And here as you can see we have this entire intent filter.

238
00:16:37,570 --> 00:16:42,760
So here it says it is going to be the main activity and it is going to be the Lanter activity.

239
00:16:43,090 --> 00:16:46,780
So here we need to actually cut these lines of code.

240
00:16:46,810 --> 00:16:55,210
This internet filter here we need to actually create another activity for the another type host activity

241
00:16:55,270 --> 00:16:56,190
as you can see here.

242
00:16:56,350 --> 00:17:02,950
So here I can just type in activity and here as you can see I can select this another type post activity

243
00:17:02,950 --> 00:17:10,990
here and I need to close this tag and inside this tag here inside this activity stack here for this

244
00:17:11,080 --> 00:17:15,510
another type of activity I need to paste that intent to filter.

245
00:17:15,580 --> 00:17:21,220
So this activity is going to be the first activity the lantern activity that is going to be shown to

246
00:17:21,220 --> 00:17:21,820
the user.

247
00:17:21,820 --> 00:17:24,780
So now let's run our project and see what happens.

248
00:17:25,000 --> 00:17:32,410
So now as you can see our application is running on this emulator here and we can see here that are

249
00:17:32,700 --> 00:17:37,630
another type host activity class is actually launched for the for the first activity as you can see

250
00:17:37,630 --> 00:17:38,170
here.

251
00:17:38,410 --> 00:17:40,170
This is our top Varan.

252
00:17:40,210 --> 00:17:43,940
This is our top two and this is our top free.

253
00:17:44,410 --> 00:17:45,110
OK.

254
00:17:45,370 --> 00:17:48,560
So I think that's enough for this tutorial.

255
00:17:48,610 --> 00:17:54,130
So if you have any questions please post the discussion in the course and then I'll do my best to answer

256
00:17:54,160 --> 00:17:55,290
all of your questions.

257
00:17:55,450 --> 00:17:59,370
Thank you very much for watching and I'll see you in the next tutorial.

