So here I can just create a street statement or an IF statement in order to actually specify that whether
the user click clicked on that specific item which its ID is this setting here or not.
So as you can see the ID settings and the title is settings for this menu.
So inside this main activity that are fine here and inside is an options item selected here I can create
an if statement if ID is equal to or that Id dot settings as you can see here the ID of this item inside
this menu underline mean that smell is setting.
As you can see here.
I have this idea at someplace that plus it is slash settings so here I can refer to the ID and then
I need to open and close this if statement.
And here I can create a toast toast object toast that make text first.
I need to specify the context main activity that this so I can just type in here item thats get title.
So here I can just get the title of this item.
So as you can see here we have this title attribute.
So in our Java code we can get the title OK come on.
And here I need to specify the length.
So I think the line for short is OK.
That sure.
So if we need to call this show me it in order to show this toast object to the user.
So let's run our project and first let's see that we have an error in our project to ask is here.
This method actually returns a value of type Boolean.
So we need to actually return a boolean value so I can't just return to here or I can just return the
super or version of this method so I can't just type in here Super on options IDM selected and here
for the argument I can't just send this item as an argument.
So let's run our project here.
And as you can see here again as you can see we have this error and we need to put a semicolon at the
end of our statement.
So let's run our project here and see what happens.
So as you can see here our application is running on this emulator here.
So if I click on the spot in here and if I click on these settings for this menu here and now it says
settings for this menu.
So now you are getting the title of this menu item as you can see here.
So hopefully that makes it that makes sense.
And inside this menu underline minute example I can create other items.
For example I can create three more items and here I need to change the IDs of these for example of
these items for example.
The second one is setting to the first one is sitting free and the fourth one is setting forth.
And again I try to change the text of these items.
For example the second one is.
Number two for example.
He's number two.
The first one is setting number free
and the fourth one is settings.
Number four.
And inside this main activity the top a file.
Here I can create an ELSE IF statement here.
Else if ID is equal to art that ID that settings to and that I need to open and close this Alsip statement.
And here again I can create another host object.
So I just copy this toast here and then paste it here.
I did that title again.
I can create another ELSE IF statement else.
If ID is equal to or that Id dot settings free and then I need to open and close this LCF statement
and here I can just put this toast object here and then its going to get the title of that specific
item.
And again I can create another LCF statement as if ID is equal to or that Id dot settings for.
And then I need to open and close this LCF statement and then I can actually create a toss object in
order to get the title of that item.
So now as you can see we are returning the super version of this MFX as soon as the return type of this
MF'er super that are an options item selected item.
So now let's run our project and see what happens.
So as you can see here now our application is running on this emulator.
So if I click on the menu button here and here we can see these options settings for this menu settings.
Number two and we can see these settings.
Number two settings number three settings.
Number of three as it was here as you can see settings number four and we can see these settings number
four here or we can actually click on the set settings for this menu and we can see the city settings
for this menu.
So this is how you create a menu in your project and later I'll talk more about creating menus and getting
values from menus.
But for now I just wanted to show you how you can actually create these items and create a menu in your
project.
So this course will be working more on this menu concept but for now its enough and I think thats enough
for this tutorial so if you have any questions please post the discussion in the course and then I do
my best to answer all of your questions.
Thank you very much for watching and I'll see you in the next tutorial.