Hire everyone in this theater you are always going to go ahead and create another Android application.
So just click on this.
Start in your Android studio project and for the application name just type in your app 46 and here
for the minimum SDK choose API 16 Android 4.1 Jelly Bean and then click on next and here choose MT activity.
OK.
Next.
And then here click on finish.
So now as you can see our application is created.
Let's actually double click on this folder here.
Double click on this layout folder and then double click on this activity underline that example.
So here as you can see this is our activity underline made that example and here we have some errors.
So in order to fix the error there is a bug in Android studio and my actually my project couldn't identify
the proper Feme.
So in order to solve that error you need to actually click on this field here at the top and then here
you can actually click on material that light or material dark.
So I prefer this material light and here choose material that light that dot dot action.
But OK I prefer I prefer this film.
You can actually choose other films but I think this film is better.
And then click on OK.
So now here is our application and we have actually a dart action bar here.
So now it's actually the selectees hello world takes you.
And then press on delete key on your keyboard.
And here now I want to actually use tab host in my application.
So inside the containers folder we have this tab host here.
OK.
So just select it and then put it inside.
These are truly inside these relatively out.
So just put it at the center of this relatively out.
OK.
So here is our tab host.
And as you can see let's actually go back go to our text tab here and here is the code.
The lines of code that are related to the user interface and here as you can see we have this tab host.
OK.
And if you have a linear layout vertical inside that table top host we have this tab widget as you can
see.
And we have this frame layout inside that tab widget as you can see here.
And we have this frame layout inside this linearly out here.
And we have also some linearly outs inside these linearly out vertical.
So let's actually delete this linearly else here.
I'll talk more about this later for now just delete them.
So now I have only a tab host and inside that tab host we have this vertical linearly out and inside
that vertical linearly out we have this tab widget and frameless out.
OK so now let's actually to go back to our design.
So here is our user interface.
And as you can see here we have these user interface components in our screen.
So let's actually to select this tab host here and now I want to actually give an idea to the top post.
So as you can see here this is the id attribute of this tab host and the default is tab host.
And I think that's OK.
OK.
So let's actually go back to our main activity the java file here.
So here we're going to actually put in some lines of code here.
So now I'm going to paste in some lines of code and then I'm going to explain to you what's going on
here.
So inside our main activity class first of all we need to actually extend from the activity group class.
Ok not an accomplished activity activity group.
So let's actually did it.
These are computer activity.
And change it to Activity Group.
OK.
And that person entered here on your keyboard.
So as you can see here it is deprecated.
And so as a developer you need to know how to actually work with this activity group.
But for now we use this activity.
And then later in this tutorial I'll talk more about using other ways in order to use taphouse in our
application.
But for now we want to use activity group.
So now I'm going to 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 two lines of code that I actually paste that here.
First of all I created an object of type Paphos.
OK.
Assignment operator.
So I actually cast this object to a tab host object find view by ID or that ID that have host.
So here I am actually referring to this tab host that I have inside are exemplified.
OK.
Inside these are relatively out.
So here I have this taphouse object.
And here in line 16 I am referring to this object tab host that's set up.
So here I want to set up the tab host for my application.
And here I call this if it gets activity local get local activity manager.
So this before comes from this activity group class.
So if you to the poll to come and keep on my keyboard.
So if you are using a Windows machine you need to hold the controls on your keyboard.
Here I just need to hold the command key and then present this method here.
And as you can see here I have this activity group that over here.
And as you can see this lever is inside this file.
Get local activity manager.
So here I need to actually get this Mefford get local activity manager in order to actually manage my
activity.
OK.
So here I'm going to put paste in some more lines of code 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 passed that I pasted here.
So here as you can see in line to anyone.
I created an object of type papped spec.
OK tab host tab spek.
And the name of this object is spech assignment operator tab host.
So here you referred to this tab host that Neal tab spit.
OK so I want to actually create some tabs in my application or.
Like a tab application so tab host that new tab spec.
So here as you can see if you have this argument and this argument is attack.
OK.
And instead of double quotes as you can see I specified the tag of this type one.
OK.
And here I in line 22 I am specifying the indicator of the spec spec that set indicator type 1.
So now I'm going to run our project and then I'm going to show you what is going to be this indicator
and 11:23 I have this intense object so intense intent one new intent.
So here I want to actually move from this activity to this activity.
OK first that activity so main activity that this this is going to be our first activity and here I
want to move to this activity.
First that activity that class.
So as you can see here we don't have this activity in our project so we need to create this activity
and inline 24 I actually referred to this spec object that said content intent.
1.
OK.
So I want to actually put this into one inside this spec OK for the content.
And here I actually add this tab to this top host tab host that add tab spec as you can see here.
So now let's actually create this first that activity in our project.
So here in our project structure as you can see here I just click on this package here and right click
on it.
OK.
And then here new.
OK.
And then click on it and as you can see we have this activity here and here I can just select is empty
activity.
OK.
And for the name of our activity I am going to use this name here.
First that activity as you can see here first tap activity and as you can see here it's going to actually
automatically create another layout with this name activity underlined first underline tap and the package
is going to be this package.
OK.
So now it says interactivity so I don't want this activity to be the lantern activity.
I want the main activity to be that interactive with you OK.
So don't check this checkbox here and then click on finish.
So here as you can see we have this first that activity in our project.
And as you can see here inside this manifest file we have this activity here inside this application
tag.
OK.
And the name that first the that first that activity.
OK.
So as you can see here at the top of this manifest file if you have these ASML namespace.
And here as you can see it specified the default package package and the name of this package is this
package.
So here it just put this dot here and then referred to this class.
Inside this package OK if you would have this class in another package we would need to actually specify
the entire name of the package that this class is inside.
OK.
But because this class is inside this package which we were just typing that first that activity as
you can see here this first activity is inside this package that is that that its name is the same as
that that this name here.
OK.
So hopefully that makes sense.
And inside this may actually be the class.
Now as you can see the error is gone.
So now let's actually open this activity underlined first underline tappet example.
And here as you can see this is our activity.
And here now I'm going to actually drag a linearly out vertical So as you can see here inside this activity
I have this linearly arithmetical here and here and when I put it at the center of this relatively out
here but as you can see here I don't like the theme of this activity of this exemplify.
So I just need to click on this app from here and then here I can just select this material light.
OK.
And here I can't just choose this material that light the dark action and then click on OK.
OK so here this is our activity and we changed the theme of this XML file and now I want to actually
drag our text view a large takes you into this XML file.
So I just need to put it at the center of this linearly Attaway article that I need.
And for the text just type in here this is first tap OK and in person enter key on your keyboard.
So now let's actually go back to our main activity the Java file here.
So first of all let's actually run our project and see what happens.
So as you can see here now our application is running on this emulator.
And here is our tab 1.
So here as you can see be assigned this value for this indicator Tab 1.
And here this is our first tab.
OK.
So this is the value that we actually put inside this activity.
Underline first underline tab that SML.
OK but here as you can see we have this action bar here.
OK.
But I don't like this to be here.
So let's actually go back to our and manifested XML file here.
So here we have this activity that main activity here and here I have to specify a field for this activity.
So here I can just typing Feme and I can just type in no action bar.
So as you can see here it says find that Afkham pads that light that no action.
So just select this and put press Enter key on your keyboard.
So now let's actually go on our project and see what happens.
So here as you can see our application is running on the simulator and we can see this tab one here.
And this is our text inside these tab one here or key activity underlined first that underline tab that
SML.
OK so now let's actually go back to our main activity that our fight here because I want to add some
more caps to my application.
So this is our first stop OK.
So here I want to create the second tab.
So now I'm going to actually paste in 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 actually pasted here and here as you can see.
Again I referred to the name of this space object that I actually created in line 21.
As you can see here top post the top spec and here I have this spec top post that new top spec one.
OK so this is the tag for this top.
OK.
And here I actually again referred to this spec object assignment operator tab host that new tab spek
to.
OK.
As you can see here we have this value too as the tag of these are Meffert new top spec.
And here as you can see in line for it to again I referred to the name of this space object that set
indicator tap to.
OK.
And in line for free.
I actually created another intense object and the name of this intense object is intense to assignment
operator new intent.
So this is going to be the activity the first activity that you want to actually transfer transfer from
so main activity that this.
And here it is going to be the second activity that you want to actually transfer to.
OK.
So I want to move from this activity main activity to the second activity.
So as you can see here we have an error.
So we need to actually create this second type activity here in our project and in line 34.
I again referred to the name of this spec object that said content intent to.
OK.
And again inline 35.
I added this tab to this tab host tab host that tab speech.
OK.
So hopefully that makes sense.
And now let's actually create this second tab activity in our project.
So just click on this package here conduct example here and then click on File new here click on activity
and then choose empty activity and the for the name of your activity name.
Just type in here.
Second tap activity.
OK.
And here as you can see we have our lay out name activity underlined second underline tab and here it
says generate outfight.
OK it's really important that you actually check this checkbox.
Otherwise it's not going to generate a out file for us.
So now click on finish and as you can see here we have this second type activity and we have also the
Smurfette set content view are that lay out that activity underline say can't underline tap and in say
does mean activity class.
Now as you can see the error is gone.
So now let's actually open our Android manifest.
Here again as you can see we have this line of code automatically here.
This line of code is actually automatically generated for us by the ID activity Android name.
That's second type activity.
OK.