Hey there.
Well let's get started and we will start by creating a new activity.
We will create a new m activity.
Call it the settings.
Activity
enough.
The building is completed.
We need to somehow go into this activity and we will do this from the menu.
To do this we need to create a menu in our main activity
open the areas folder and create and you drove directory here in the race folder and you folder call
it menu and type menu click okay and this and then in this main menu we create a new eczema menu or
a sauce file.
Here it is.
We choose it.
Call it for example timer menu dot simple click Okay.
We need to add here the namespace of application X and I'll add as up equals age TTP schemas Android
call a bouquet or is autumn or when.
Then we need to add an element to this menu using the example element item.
Close the tag and inside if we hover over the red line it says that the menu elements should indicate
the title will right and title.
Here for example let's call settings our menu let's also give an I.D.
We'll call action settings.
For example then such an element as order in category
equals 100 let's set the value and show as action never.
I will explain it all later when we create our menu then it will be more clear and obvious for now.
Just write down these attributes and know that we have created this menu item.
We can go to all main activity and Bill Press Control Oh and we will get a lease of methods that we
can override like great click on Create options I write and create options menu and this method is I
got it.
Press a key and here the fault quote of this method and to create the menu we must override this method.
Delete this line for start.
Now I should get the inflate menu that is menu inflated pumps up creates a menu where right menu inflate
class called Object menu inflator in the same way and assign the value that I get from that get menu
inflator method.
Then right menu inflate inflate.
And here we specify our menu.
Which is located here.
And specify the name of these file timer menu.
And the second parameter.
We pass these as this parameter that is included in the create options menu method and then returns
the true this is their recording form of this method.
And now we can run the application
and as you can see here we have this kind of fight on here and menu has appeared.
If we click on it the settings value appears fine.
Well let's experiment a little with the menu.
Let's create some more items in the menu.
Let's copy this item maximal element and paste in a couple more elements.
Let's specify a ball here action about
here purchase for example to buy something in our application.
And now let's change the priority here.
Order in category.
Let about B one hundred and ten and purchases.
Let it be fifty five and restore the application.
So let's click on the menu and as you see the items appear in what order do they appear.
The first CPS pushes because it has order in category 55.
That is roughly 55 in order.
But since there is no item before it it is displayed.
First there will sound fifty four or thirty eight.
Then it would be displayed first before it.
Next in order is 100.
Setting as you see they are indicated by second settings and one hundred and ten.
The largest 0 number is displayed lost.
That is the law.
This value the earlier this item appears in the media.
I think this understanding.