How to Create Menu in Android Studio using Java | Android Knowledge

  Рет қаралды 12,993

Android Knowledge

Android Knowledge

Күн бұрын

Welcome to Android Knowledge!
In this video, I am going to create options menu in the top action bar in android studio using java and xml. We have created menu_item android resource file and then inflated in MainActivity using MenuInflator, also we have created two override methods as well.
1. onCreateOptionsMenu
2. onOptionsItemSelected
Follow us on Instagram:
/ android_knowledge
Chapters:
0:00 - Intro
0:11 - Create New Project
0:32 - Add Vector Asset in Drawable Folder
2:03 - Create Menu Android Resource File
2:23 - menu_item.xml
5:20 - MainActivity.java
9:05 - Output
Keywords:
how to create menu in android studio
how to add menu in android studio
how to create menu in android
menu android studio
options menu android studio
toolbar menu android
menu android
toolbar menu android studio
Hashtags:
#android #menu #java #coding #androidstudio
If you have any queries or errors, please feel free to comment below :-)
Please subscribe to my channel 😊👍
All rights reserved by Android Knowledge!

Пікірлер: 14
@iqra.shaikh
@iqra.shaikh Жыл бұрын
Easy to implement, thanks!
@android_knowledge
@android_knowledge Жыл бұрын
You're welcome!
@shazneenshaikh7515
@shazneenshaikh7515 Жыл бұрын
Nice one
@android_knowledge
@android_knowledge Жыл бұрын
Thanks!😊👍🏻
@user-qw4tn8it8h
@user-qw4tn8it8h 7 ай бұрын
what about activity_main.xml in this code??
@novayoutube2937
@novayoutube2937 Жыл бұрын
Very informative 👍🏼
@android_knowledge
@android_knowledge Жыл бұрын
😊👍🏻
@MrsXueLi
@MrsXueLi 6 ай бұрын
Why mine shows the hello world but not the menu
@pyprogrammer
@pyprogrammer 5 ай бұрын
You can check res/values/themes/* files to support ActionBar.
@Asian642
@Asian642 Жыл бұрын
I did the same but its showing errors on swtich case
@android_knowledge
@android_knowledge Жыл бұрын
Use if else instead of switch case.
@Asian642
@Asian642 Жыл бұрын
@@android_knowledge can u plz guide me how to use if else for menu?
@percygwala3502
@percygwala3502 5 ай бұрын
I'm having the same issue, please show us how to write it as if else
@kenn_obi
@kenn_obi Ай бұрын
public boolean onOptionsItemSelected(@NonNull MenuItem item) { int itemId = item.getItemId(); if (itemId == R.id.settings){ Toast.makeText(this,"You have clicked on settings",Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.share) { Toast.makeText(this,"You have clicked on share",Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.aboutus) { Toast.makeText(this,"You have clicked on aboutus",Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.logout) { Toast.makeText(this,"You have clicked on logout",Toast.LENGTH_SHORT).show(); return true; }
Fragments in Android Studio 2022 | Tab Layout
9:45
Android Knowledge
Рет қаралды 4,2 М.
How To Create WebView App In Android Studio
8:22
Ghost Together
Рет қаралды 64 М.
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 8 МЛН
Como crear un Menú en Android
15:50
Alex Pagoada
Рет қаралды 7 М.
Navigation Drawer Menu in Android Studio using Java | 2024
20:46
Android Knowledge
Рет қаралды 83 М.
How to Implement menu in Android Activity with Options Menu
5:20
Lemubit Academy
Рет қаралды 17 М.
Beginning Flutter - Intermediate - Using Common Widgets
4:44
JediPixels
Рет қаралды 76 М.
How to create menu in android studio
8:40
Tech Projects
Рет қаралды 13 М.
Menu in Android | Android Tutorial for Beginners
10:16
Telusko
Рет қаралды 41 М.
Bottom Navigation Bar in Android Studio using Java | Explanation
14:12
Android Knowledge
Рет қаралды 44 М.
How to Create Fragments in Android Studio (2023) | Fragment Activity
11:40
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 19 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 106 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 7 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 64 МЛН