SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Menus
• Menus are an important part of an activity's user
interface, which provide users a familiar way to perform
actions.
• Android offers a simple framework for you to add
standard menus to your application.
• There are three types of application menus:
• Options Menu
• Context Menu
• Submenu
Options Menus
• The Option Menus are the primary collection of menu
items for an activity, which appears when the user
touches the MENU button
• Options menu is divided into 2 types:
Icon Menu
Expanded Menu
Options Menus
Icon Menu
Options menu can have any number of menu options, but
only the first six options are shown directly when the
MENU key is clicked and this is called as Icon Menu.
Expanded Menu
In case there are more than six options then first five are
shows directly and remaining are available when more
button is clicked and is called as Expanded Menu
Methods of Option Menus
onCreateOptionsMenu()
This method of the Activity is called when the user
clicks the Menu Key of the device.
onOptionItemSelected() 
This method of the activity is called when a particular
Item/Option of the menu is clicked.
add()
Multiple add() methods are available. Use the one that
accepts itemId as a parameter.
setIcon() : This is used for assigning icon with the option
Context Menus
Android provides the facility to open a menu in context
with the object clicked. A Long-press on the view will bring
up the registered Context menu.
registerForContextMenu()
Using this method view is registered for context menu.
onCreateContextMenu()
This method will call when we Click on(long press) registered
view
onCreateContextMenu()
This method will call when ever we select the item/option
Sub Menus
• A floating list of menu items that appears when the user
touches a menu item that contains a nested menu.
addSubMenu()
By this method we will dynamically add a submenu to an
existing Menu
onOptionsItemSelected()
This method is called when a submenu item is selected.
Examples on Menus
This is the example of
android option menu.
Here if the user press
the menu button the
below menu items will
appear on the screen,
here you will find the
home, search, delete
and some other menus,
in that menus each and
every menu has
different functionality.
(view source)
Examples on Menus
(view source)
This is the example of
android context menu.
if the user do the long
press on the button the
context menu will
open ,on the context
menu bar we have 2
buttons ,each button
has different
functionality if you click
on that
Examples on Menus
(view source)
If Pressed on Home Icon

Weitere ähnliche Inhalte

Was ist angesagt?

Android activity
Android activityAndroid activity
Android activity
Krazy Koder
 
android content providers
android content providersandroid content providers
android content providers
Deepa Rani
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentprovider
Krazy Koder
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
Bhumivaghasiya
 

Was ist angesagt? (20)

Android intents
Android intentsAndroid intents
Android intents
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
Android ui menu
Android ui menuAndroid ui menu
Android ui menu
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
Android activity
Android activityAndroid activity
Android activity
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
android content providers
android content providersandroid content providers
android content providers
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
05 intent
05 intent05 intent
05 intent
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Android Location and Maps
Android Location and MapsAndroid Location and Maps
Android Location and Maps
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Event handling
Event handlingEvent handling
Event handling
 
Android Services
Android ServicesAndroid Services
Android Services
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentprovider
 
Applets
AppletsApplets
Applets
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 

Andere mochten auch

Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]
Nehil Jain
 
Speed controller of dc motor
Speed controller of dc motorSpeed controller of dc motor
Speed controller of dc motor
Deepa Rani
 

Andere mochten auch (17)

Menu in android
Menu in androidMenu in android
Menu in android
 
Action Bar and Menu
Action Bar and MenuAction Bar and Menu
Action Bar and Menu
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
Android in practice
Android in practiceAndroid in practice
Android in practice
 
Android Training - Sliding Menu
Android Training - Sliding MenuAndroid Training - Sliding Menu
Android Training - Sliding Menu
 
Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]
 
Speed controller of dc motor
Speed controller of dc motorSpeed controller of dc motor
Speed controller of dc motor
 
Android App Development - 06 Fragments
Android App Development - 06 FragmentsAndroid App Development - 06 Fragments
Android App Development - 06 Fragments
 
Intent in android
Intent in androidIntent in android
Intent in android
 
Sacramento Airport Rabbit
Sacramento Airport RabbitSacramento Airport Rabbit
Sacramento Airport Rabbit
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
Evolución del sistema inmune una perspectiva genómica 2017
Evolución del sistema inmune una perspectiva genómica 2017Evolución del sistema inmune una perspectiva genómica 2017
Evolución del sistema inmune una perspectiva genómica 2017
 
Nossos serviços em Projetos de Arquitetura
Nossos serviços em Projetos de ArquiteturaNossos serviços em Projetos de Arquitetura
Nossos serviços em Projetos de Arquitetura
 
حكم الإسلام في الغناء والموسيقي للشيخ القرضاوي
حكم الإسلام في الغناء والموسيقي للشيخ القرضاويحكم الإسلام في الغناء والموسيقي للشيخ القرضاوي
حكم الإسلام في الغناء والموسيقي للشيخ القرضاوي
 
Konkurenční výhody konkurence — BusinessAkademie 2016
Konkurenční výhody konkurence — BusinessAkademie 2016Konkurenční výhody konkurence — BusinessAkademie 2016
Konkurenční výhody konkurence — BusinessAkademie 2016
 
GuardMagic Universal Monitoring Platform.
GuardMagic Universal Monitoring Platform.GuardMagic Universal Monitoring Platform.
GuardMagic Universal Monitoring Platform.
 
Causes I support: 2017
Causes I support: 2017Causes I support: 2017
Causes I support: 2017
 

Ähnlich wie android menus

1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx
honey725342
 
Lecture windows xp 3
Lecture windows xp 3Lecture windows xp 3
Lecture windows xp 3
Shafaq Saleem
 
Power Point Lesson 07 P2
Power Point Lesson 07 P2Power Point Lesson 07 P2
Power Point Lesson 07 P2
Nasir Jumani
 

Ähnlich wie android menus (20)

Intake 37 8
Intake 37 8Intake 37 8
Intake 37 8
 
Intake 38 8
Intake 38 8Intake 38 8
Intake 38 8
 
Android menus in android-chapter15
Android menus in android-chapter15Android menus in android-chapter15
Android menus in android-chapter15
 
01 10 - graphical user interface - others
01  10 - graphical user interface - others01  10 - graphical user interface - others
01 10 - graphical user interface - others
 
Android session 3
Android session 3Android session 3
Android session 3
 
Windows xp
Windows xpWindows xp
Windows xp
 
Windows xp stack
Windows xp stackWindows xp stack
Windows xp stack
 
user interface.pptx
user interface.pptxuser interface.pptx
user interface.pptx
 
1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx
 
Menu stripe
Menu stripeMenu stripe
Menu stripe
 
Lecture windows xp 3
Lecture windows xp 3Lecture windows xp 3
Lecture windows xp 3
 
Vs c# lecture5
Vs c# lecture5Vs c# lecture5
Vs c# lecture5
 
Android App development III
Android App development IIIAndroid App development III
Android App development III
 
Power Point Lesson 07 P2
Power Point Lesson 07 P2Power Point Lesson 07 P2
Power Point Lesson 07 P2
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Interaksi manusia dan komputer
Interaksi manusia dan komputerInteraksi manusia dan komputer
Interaksi manusia dan komputer
 
Introduction to the Module Menu
Introduction to the Module MenuIntroduction to the Module Menu
Introduction to the Module Menu
 
Slide interaksi manusia dan komputer
Slide interaksi manusia dan komputerSlide interaksi manusia dan komputer
Slide interaksi manusia dan komputer
 
Android user interface design-chapter13
Android user interface design-chapter13Android user interface design-chapter13
Android user interface design-chapter13
 
Android Lab Test : Creating a menu context (english)
Android Lab Test : Creating a menu context (english)Android Lab Test : Creating a menu context (english)
Android Lab Test : Creating a menu context (english)
 

Mehr von Deepa Rani

Foot step power generator
Foot step power generatorFoot step power generator
Foot step power generator
Deepa Rani
 
Crime investigation system
Crime investigation systemCrime investigation system
Crime investigation system
Deepa Rani
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
android dilaogs
android dilaogsandroid dilaogs
android dilaogs
Deepa Rani
 
android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
android activity
android activityandroid activity
android activity
Deepa Rani
 
android architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution processandroid architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution process
Deepa Rani
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copy
Deepa Rani
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themes
Deepa Rani
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structures
Deepa Rani
 
Fabric innovation
Fabric innovationFabric innovation
Fabric innovation
Deepa Rani
 
Typical problem
Typical problemTypical problem
Typical problem
Deepa Rani
 
straight line
straight line straight line
straight line
Deepa Rani
 
Section of solids
Section of solidsSection of solids
Section of solids
Deepa Rani
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
Deepa Rani
 
Development of surfaces of solids
Development of surfaces of solidsDevelopment of surfaces of solids
Development of surfaces of solids
Deepa Rani
 

Mehr von Deepa Rani (20)

Foot step power generator
Foot step power generatorFoot step power generator
Foot step power generator
 
Crime investigation system
Crime investigation systemCrime investigation system
Crime investigation system
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
android dilaogs
android dilaogsandroid dilaogs
android dilaogs
 
android layouts
android layoutsandroid layouts
android layouts
 
android activity
android activityandroid activity
android activity
 
android architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution processandroid architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution process
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copy
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themes
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structures
 
Blue Brain
Blue BrainBlue Brain
Blue Brain
 
Tcp
TcpTcp
Tcp
 
Dc machiness
Dc machinessDc machiness
Dc machiness
 
Maddy android
Maddy androidMaddy android
Maddy android
 
Fabric innovation
Fabric innovationFabric innovation
Fabric innovation
 
Typical problem
Typical problemTypical problem
Typical problem
 
straight line
straight line straight line
straight line
 
Section of solids
Section of solidsSection of solids
Section of solids
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
 
Development of surfaces of solids
Development of surfaces of solidsDevelopment of surfaces of solids
Development of surfaces of solids
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

android menus

  • 1.
  • 2. Menus • Menus are an important part of an activity's user interface, which provide users a familiar way to perform actions. • Android offers a simple framework for you to add standard menus to your application. • There are three types of application menus: • Options Menu • Context Menu • Submenu
  • 3. Options Menus • The Option Menus are the primary collection of menu items for an activity, which appears when the user touches the MENU button • Options menu is divided into 2 types: Icon Menu Expanded Menu
  • 4. Options Menus Icon Menu Options menu can have any number of menu options, but only the first six options are shown directly when the MENU key is clicked and this is called as Icon Menu. Expanded Menu In case there are more than six options then first five are shows directly and remaining are available when more button is clicked and is called as Expanded Menu
  • 5. Methods of Option Menus onCreateOptionsMenu() This method of the Activity is called when the user clicks the Menu Key of the device. onOptionItemSelected()  This method of the activity is called when a particular Item/Option of the menu is clicked. add() Multiple add() methods are available. Use the one that accepts itemId as a parameter. setIcon() : This is used for assigning icon with the option
  • 6. Context Menus Android provides the facility to open a menu in context with the object clicked. A Long-press on the view will bring up the registered Context menu. registerForContextMenu() Using this method view is registered for context menu. onCreateContextMenu() This method will call when we Click on(long press) registered view onCreateContextMenu() This method will call when ever we select the item/option
  • 7. Sub Menus • A floating list of menu items that appears when the user touches a menu item that contains a nested menu. addSubMenu() By this method we will dynamically add a submenu to an existing Menu onOptionsItemSelected() This method is called when a submenu item is selected.
  • 8. Examples on Menus This is the example of android option menu. Here if the user press the menu button the below menu items will appear on the screen, here you will find the home, search, delete and some other menus, in that menus each and every menu has different functionality. (view source)
  • 9. Examples on Menus (view source) This is the example of android context menu. if the user do the long press on the button the context menu will open ,on the context menu bar we have 2 buttons ,each button has different functionality if you click on that
  • 10. Examples on Menus (view source) If Pressed on Home Icon