1
00:00:00,620 --> 00:00:08,010
So here I can just create a street statement or an IF statement in order to actually specify that whether

2
00:00:08,020 --> 00:00:16,430
the user click clicked on that specific item which its ID is this setting here or not.

3
00:00:16,440 --> 00:00:20,910
So as you can see the ID settings and the title is settings for this menu.

4
00:00:20,910 --> 00:00:27,090
So inside this main activity that are fine here and inside is an options item selected here I can create

5
00:00:27,180 --> 00:00:39,960
an if statement if ID is equal to or that Id dot settings as you can see here the ID of this item inside

6
00:00:39,960 --> 00:00:42,330
this menu underline mean that smell is setting.

7
00:00:42,360 --> 00:00:43,270
As you can see here.

8
00:00:43,470 --> 00:00:50,520
I have this idea at someplace that plus it is slash settings so here I can refer to the ID and then

9
00:00:50,520 --> 00:00:52,460
I need to open and close this if statement.

10
00:00:52,500 --> 00:00:58,660
And here I can create a toast toast object toast that make text first.

11
00:00:58,680 --> 00:01:06,860
I need to specify the context main activity that this so I can just type in here item thats get title.

12
00:01:07,020 --> 00:01:09,410
So here I can just get the title of this item.

13
00:01:09,420 --> 00:01:12,430
So as you can see here we have this title attribute.

14
00:01:12,600 --> 00:01:16,330
So in our Java code we can get the title OK come on.

15
00:01:16,740 --> 00:01:19,110
And here I need to specify the length.

16
00:01:19,140 --> 00:01:21,790
So I think the line for short is OK.

17
00:01:22,100 --> 00:01:23,620
That sure.

18
00:01:23,940 --> 00:01:28,650
So if we need to call this show me it in order to show this toast object to the user.

19
00:01:28,660 --> 00:01:35,010
So let's run our project and first let's see that we have an error in our project to ask is here.

20
00:01:35,120 --> 00:01:39,110
This method actually returns a value of type Boolean.

21
00:01:39,150 --> 00:01:47,460
So we need to actually return a boolean value so I can't just return to here or I can just return the

22
00:01:47,460 --> 00:01:54,720
super or version of this method so I can't just type in here Super on options IDM selected and here

23
00:01:54,990 --> 00:02:00,510
for the argument I can't just send this item as an argument.

24
00:02:00,660 --> 00:02:02,180
So let's run our project here.

25
00:02:02,190 --> 00:02:08,550
And as you can see here again as you can see we have this error and we need to put a semicolon at the

26
00:02:08,550 --> 00:02:09,950
end of our statement.

27
00:02:10,020 --> 00:02:12,870
So let's run our project here and see what happens.

28
00:02:12,870 --> 00:02:17,480
So as you can see here our application is running on this emulator here.

29
00:02:17,520 --> 00:02:23,550
So if I click on the spot in here and if I click on these settings for this menu here and now it says

30
00:02:23,640 --> 00:02:24,980
settings for this menu.

31
00:02:25,110 --> 00:02:30,880
So now you are getting the title of this menu item as you can see here.

32
00:02:31,020 --> 00:02:33,260
So hopefully that makes it that makes sense.

33
00:02:33,270 --> 00:02:37,380
And inside this menu underline minute example I can create other items.

34
00:02:37,380 --> 00:02:44,100
For example I can create three more items and here I need to change the IDs of these for example of

35
00:02:44,100 --> 00:02:46,100
these items for example.

36
00:02:46,100 --> 00:02:53,090
The second one is setting to the first one is sitting free and the fourth one is setting forth.

37
00:02:53,400 --> 00:02:57,660
And again I try to change the text of these items.

38
00:02:57,660 --> 00:03:00,420
For example the second one is.

39
00:03:00,420 --> 00:03:02,580
Number two for example.

40
00:03:02,610 --> 00:03:03,730
He's number two.

41
00:03:03,930 --> 00:03:06,150
The first one is setting number free

42
00:03:08,830 --> 00:03:11,480
and the fourth one is settings.

43
00:03:11,620 --> 00:03:13,810
Number four.

44
00:03:14,360 --> 00:03:16,330
And inside this main activity the top a file.

45
00:03:16,330 --> 00:03:20,140
Here I can create an ELSE IF statement here.

46
00:03:20,140 --> 00:03:31,710
Else if ID is equal to art that ID that settings to and that I need to open and close this Alsip statement.

47
00:03:31,710 --> 00:03:35,450
And here again I can create another host object.

48
00:03:35,460 --> 00:03:39,030
So I just copy this toast here and then paste it here.

49
00:03:39,110 --> 00:03:40,980
I did that title again.

50
00:03:40,980 --> 00:03:44,810
I can create another ELSE IF statement else.

51
00:03:44,850 --> 00:03:53,550
If ID is equal to or that Id dot settings free and then I need to open and close this LCF statement

52
00:03:53,580 --> 00:04:00,690
and here I can just put this toast object here and then its going to get the title of that specific

53
00:04:00,750 --> 00:04:01,530
item.

54
00:04:01,530 --> 00:04:11,690
And again I can create another LCF statement as if ID is equal to or that Id dot settings for.

55
00:04:12,210 --> 00:04:17,370
And then I need to open and close this LCF statement and then I can actually create a toss object in

56
00:04:17,370 --> 00:04:20,560
order to get the title of that item.

57
00:04:20,580 --> 00:04:27,480
So now as you can see we are returning the super version of this MFX as soon as the return type of this

58
00:04:27,480 --> 00:04:31,390
MF'er super that are an options item selected item.

59
00:04:31,410 --> 00:04:34,860
So now let's run our project and see what happens.

60
00:04:34,860 --> 00:04:38,840
So as you can see here now our application is running on this emulator.

61
00:04:38,850 --> 00:04:45,330
So if I click on the menu button here and here we can see these options settings for this menu settings.

62
00:04:45,330 --> 00:04:47,420
Number two and we can see these settings.

63
00:04:47,430 --> 00:04:50,550
Number two settings number three settings.

64
00:04:50,550 --> 00:04:55,800
Number of three as it was here as you can see settings number four and we can see these settings number

65
00:04:55,800 --> 00:05:01,650
four here or we can actually click on the set settings for this menu and we can see the city settings

66
00:05:01,920 --> 00:05:03,710
for this menu.

67
00:05:03,750 --> 00:05:11,040
So this is how you create a menu in your project and later I'll talk more about creating menus and getting

68
00:05:11,040 --> 00:05:12,750
values from menus.

69
00:05:12,900 --> 00:05:18,480
But for now I just wanted to show you how you can actually create these items and create a menu in your

70
00:05:18,480 --> 00:05:19,470
project.

71
00:05:19,660 --> 00:05:28,260
So this course will be working more on this menu concept but for now its enough and I think thats enough

72
00:05:28,290 --> 00:05:34,110
for this tutorial so if you have any questions please post the discussion in the course and then I do

73
00:05:34,110 --> 00:05:36,010
my best to answer all of your questions.

74
00:05:36,150 --> 00:05:40,020
Thank you very much for watching and I'll see you in the next tutorial.

