So let's actually do it on our project and see what happens.
So now as you can see our application is running on this emulator and we have this tab on here and we
have this I have to Celeste's Let's actually select this tab to here and we have nothing inside this
tab.
So let's actually open our activity on the length socket.
On second underline tablet example.
And now let's actually change the theme of this XML file.
So just click on this app fame and material light and choose the second one material that lights the
action bar and lets actually drag a large text view here and just type click on it.
And for the text just typing here.
Second activity.
And then press Enter key on your keyboard.
So let's actually run our project again and see what happens.
So now as you can see our application is running on this emulator.
So let's actually select this tab to here and here we can see this second activity here.
So hopefully that makes sense.
And now let's actually go back to what the main activity that you will find here.
Let's actually add another tap to our application.
So now I'm going to actually pasting some more lines of code here and then I'm going to explain to you
what's going on here.
So as you can see here these are the lines of code that I pasted here.
And as you can see again I'll refer to the name of this spek object assignment operator tab host that
new tab spec and this is going to be the tag.
OK free.
So now I have actually this line of code here in line 42.
You referred to this to the name of this spec object that set indicator top free as you can see here.
And we have this free as a tag.
OK.
And in line free I have this intense object intent for the new intense main activity that this and first
tap activity that class.
So we don't have this forever type activity class yet.
We're going to create it in a minute and in line 44 I actually referred to the name of this spec object
spec that said content intent free and inline 44.
I added this tab to this tab host top host that at top spec.
So now let's actually create a fresh activity in our project.
I just need to click on this package here and then click on File new activity empty activity and for
the name of our activity I can't just type in ferde tap activity.
And here just click on finish and now as you can see we have this activity and in our main activity
class now the error is gone.
So just click on these first tab activity here that example just click on this activity underline the
underlined tab that examen.
So let's change the theme of this exemplify.
So Feme material light and material that light that dot action dodge action bar OK and then click on
OK.
Now let's actually drag a large text view here and double click on it for the text just typing here.
Fair activity.
And then person enter key on your keyboard.
So now let's actually run our project and see what happens.
So here as you can see our application is running on this emulator and we have this tab 1 tab 2 and
tab free.
OK.
So this is how you can actually create a tab application in your project.
And I think that's enough for this kind of Paphos.
But I think we can actually create another tab host in our project so actually create and.
Lay out fine.
So just like we can lay out fine here and in New and then lay out resource wide Okay.
So for the name of your resource file just typing here and other you need to actually write your filenames
your filenames in lowercase.
OK another type I know there's type post.
OK.
And for the root element choose a relative lay out OK and source said Main.
Well that's OK.
And for the directory name out.
OK.
And then click on.
OK.
So we have this and other type host.
Now our list actually to change the theme of this XML file.
So just to click on app Feme material light material that light that dark action mode.
So now it's actually double click on this and either underline top that underline host that example
here.
And I want to actually drag a tab host into this relatively out here.
So inside these containers folder if you have these tab host widget here.
OK.
So just select it and put it here at the center of this relatively out.
And as you can see here we have this tab host here inside this componentry section.
And now as you can see we have these free linearly.
This time I don't want to delete this linearly out.
OK.
So let's actually go inside our Takes here takes tap and here and as you can see we have these linear
layouts inside this frame layer.
OK.
So now I want to actually add some more components inside these linearly outs.
For example first of all I want to change the background color of these linearly else so I can just
type in background and I can just typing in for example I can just select this assigned color here and
then here I can just hold the control key and then present the space key on my keyboard.
And here we have these three colors here.
OK.
So for the first tab I want to choose this color primary and for this linearly out as you can see here.
Again I want to change the background color of this linearly out.
So here I can just type in background color and I just need to hold the control key on my keyboard and
then press on the space.
And here this time choose colored accent and again I want to change the background color of this linear
layer.
OK.
So I can't just type in background and selected and color and hold the control key on my keyboard.
And here this time I want to choose this color primary Dortch.
So here I actually to change the background colors of these linear layouts here.
As you can see here the back end of these linearly else that are inside of this frame.
OK.
So remember that I actually didn't delete these linear layouts here for this kind of exemplify.
OK.
Because in this.
Now I want to actually show you how you can create your host in an other way.
OK.
So now I want to actually put a text view inside these linearly outs.
OK.
So for this linearly out here inside this linearly out as you can see this is the starting linearly
out and this is the ending of this linearly other case so inside this linear linearly out all you want
to create a text view.
So just open a takes text view and for the layout Veith just assign the value match parent.
And for the layout height assigned the value wrap content.
And it's actually add another attribute text for the text just type in here.
This is our first tap.
OK.
And again for this Secondly nearly out insight this linearly out here.
Again I want to create another text view.
So just open a tag selected for the out which is saying the value match parent for the layout height
assigning the value or content.
And for the text attributes just typing here this is secant second tap.
And again we have another linearly out.
So in Enceladus linearly or here again I want to create another text view for the layout which assigned
a value match parent for the layout height assign the value or content and for the text attributes assigned
the value.
This is first tap.
OK so I have this ACAP host inside our user interface as you can see here.
And as you can see I actually changed the background color of these linear layouts.
So now let's actually create a java file that is going to be related to this exemplified another type
host.
OK.
So here in order to do that in our project structure I just need to select this package here and then
I just need to right click on this package new and then select this Java class and for the name of your
activity you can just typing activity.
Or you can just typing in another
type host OK activity and other type hosts activity and then click on OK.
So this is going to be our class.
So this class is going to be inheriting all of the features and behaviors of the of the outcome productivity.
OK.
Like all our classes in our Android applications that we created so far.
OK.
So this time I don't want to inherit all of the features and behaviors of the activity group or kids
as we did inside this main activity that will fight here.
Are you going to actually inherit from this accompted activity and now I need to actually overwrite
the uncreate method and create method.
And then as you can see here I just need to select this uncreate method that actually accepts this argument
to save instance state and then press enter key on my keyboard.
So this is our uncreate method.
And now I need to actually call the set content view method on this uncreate method inside is and create
Meffert.
So here I can just type in sets content's view.
And here I can just type in our thoughts lay layout dots as you can see here we can actually choose
or exemplifies that we created in our lay out there.
So here I have this activity type host.
So here I have this and another type host here this XML file.
So I just need to select it.
So it is going to actually load up this XML file when we actually are going to actually open this activity.
OK.
So this XML file is going to be related only to this and others type hosts activity.
OK.
So now when I actually paste in some lines of code here and then I'm going to explain to you what's
going on here.
So as you can see here these are the lines of code that I actually pasted here.
Tab host and the name of my object is host assignment operator and here as you can see I am actually
casting this object way to a tab host object find view by ID or that ID that tab host.
OK so now so as you can see here because we have this I-T we have this ID twice in our project.
OK.
Once in our main activity class we actually use this ID and here are another type hostes activity.
Again we are using this idea.
It's better to change this ID to another ID.
So insight are another underlying top Underland host that the example I just need to select is to have
host to here and here as you can see the idea of this tab host is Paphos to.
OK.
So in our and others type hosts activity that job file here I just need to change it to tap host to.
OK.
So it's going to actually use that specific tap host.
And here I just actually get that object.
And here again I actually referred to the name of this object host that set up so it can actually set
up that tab host for us.
OK.
And here I am when I actually pasting some more lines of code here and then I'm going explain to you
what's going on here.
So as you can see here these are the lines of code that I actually pasted here.
OK.
So first of all of you have this tab on here.
Tab host tab spech spake.
So here I am actually creating an object of type tap's pitch and the name of this object is spech assignment
operator.
Post the New Tab spec tab.
1.
So this is going to be the task ok for this spec here.
And then here again in line 41 as you can see I referred to the name of this special object that sits
content.
OK.
And inside the practices are that Id tap one.
So here we need to specify that Veach tab which activity is going to be the first tap.
So here I referred to this idea open or another underline type Underland hosted example.
So as you can see here it does a linearly else as you can see are going to be the activities that we
want to actually put inside our taps.
OK so for example this first linearly out here is going to be the first step.
This second linearly out here is going to be the second type and this is fairly linearly out here.
It's going to be the first type.
So just select this first linearly out here.
And as you can see I can actually change the ID of this linear layout.
So as you can see we have this ID attribute that is related to this linear layout.
I just need to select it and delete the ID and I can just type in Tab 1 and then press on energy on
your keyboard and again select the second linearly out here for the ID just type in here tap 2.
Again first linearly out here and delete this default ID and just type in here tab free and press on
key on your keyboard.
And as you can see here the ideas changed.
So let's go back to what another type host activity here.
And now as you can see the error is gone.
OK.
And here in line for 82 amp setting the indicator spec that said indicator of tap 1 post as you can
see here I referred to this host here that is off the top post that at top spec.
And again we have this tap too.
OK.
Spec assignment operator host that new top spec top to spec that said content are that Id have to spec
that said indicator tap tap 2.
OK.
And here in line for 49 I am adding does that have to do is host host that at top spec.
And again here we are actually adding the first top spec assignment operator host that new top spec
tap free spec that said content.
So here I am actually setting the content of this type are that I didn't have free spec that said indicator
tab free.
And here I am actually adding that have to do is host host that tab spec.
So now if we actually run our project let's see what happens.
So here as you can see our application is running on this emulator.
But here there is a problem we cannot see it is another type host activity that we created here but
we are actually seeing this main activity that we actually put our taps here.
OK.
So how we can actually see this and other type of activity.
So the answer is inside these Android manifest FOID.
So here in our Android manifest file I just need to open this and the manifest file.
And here as you can see for this activity tag here as you can see here this is our main main activity
here.
OK.
And here as you can see we have this entire intent filter.
So here it says it is going to be the main activity and it is going to be the Lanter activity.
So here we need to actually cut these lines of code.
This internet filter here we need to actually create another activity for the another type host activity
as you can see here.
So here I can just type in activity and here as you can see I can select this another type post activity
here and I need to close this tag and inside this tag here inside this activity stack here for this
another type of activity I need to paste that intent to filter.
So this activity is going to be the first activity the lantern activity that is going to be shown to
the user.
So now let's run our project and see what happens.
So now as you can see our application is running on this emulator here and we can see here that are
another type host activity class is actually launched for the for the first activity as you can see
here.
This is our top Varan.
This is our top two and this is our top free.
OK.
So I think that's enough for this tutorial.
So 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'll see you in the next tutorial.