SlideShare une entreprise Scribd logo
1  sur  10
Using Action Bar
Action Bar
• The action bar is a window feature that identifies the
  application and user location, and provides user actions and
  navigation modes.
• You should use the action bar in most activities that need to
  prominently present user actions or global navigation.
• You can control the behaviors and visibility of the action bar
  with the ActionBar APIs, which were added in Android 3.0 (API
  level 11).
• To use ActionBar in previous Android versions there is a Library
  ‘ActionBarSherlock’ which can be downloaded from
  http://actionbarsherlock.com/
• ActionBarSherlock supports from Android 2.0 and over.
Using ActionBarSherlock(ABS)
  • To use ABS it has to be
    imported in eclipse and
    has to be an opened
    project.
  • Create a new Android
    project in Eclipse.
  • In create project
    window select ‘Create
    project from existing
    source’
  • In the location browse
    to the ‘library folder’ in
    ABS library which was
    downloaded.
Using ActionBarSherlock(ABS)
 • Go to the build path
   window of action bar
   project.
 • Under Libraries tab add
   jar ‘android-support-
   v4.jar’ which is already
   included in the libs
   folder.


 • Also set the build
   target to API 14 or
   higher.
 • Though ABS will be
   used with 2.0 or above
   it requires to be built
   with 4.0 or higher
Using ActionBarSherlock(ABS)
 • Now create a new
   project in Eclipse
   with minimum SDK
   7 and set Build
   target to 15.
Using ActionBarSherlock(ABS)
• Go to the project properties
  again and in the library
  section add the Previous
  created ‘ActionBarSherlock’
  library

• Since the action bar widget is
  very complex it requires a set
  of default themes. The
  library provides three core
  themes—one                  of
  which must be applied to
  each activity on which you
  want the action bar present.
• In the Manifest set theme in
  the appication tag for all
  activities or or under specific
  Activities
• ‘android:theme="@style/Theme.S
  herlock">’
• Now we are ready to integrate
  Action Bar.
• To Enable Action Bar for any
  activity, the Activity must
  extend        ‘SherlockActivity’
  instead of ‘Activity’
• To access ActionBar use
  getSupportActionBar() instead
  of getActionBar().
Adding Menu in ActionBar
• To add menu in ActionBar use menu like
  optionsMenu.
• Define in the XML but Add the tag
  ‘showAsAction’ and set it to ‘ifRoom’
• Now       in   the       Activity’s  onCreateOptionsMenu()         use
     getSupportMenuInflater() to get the menu inflater and inflate the XML
     menu file
• In                the
  onOptionsItemSelect
  ed() do the necessary
  jobs identified menu
  items by ‘id‘ set in
  the XML file
• Here is the result

Contenu connexe

En vedette

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities Ahsanul Karim
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedAhsanul Karim
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)Ahsanul Karim
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS TutorialAhsanul Karim
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentAhsanul Karim
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting startedAhsanul Karim
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivityAhsanul Karim
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Ahsanul Karim
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesAhsanul Karim
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overviewAhsanul Karim
 

En vedette (20)

Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
List Views
List ViewsList Views
List Views
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting Started
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS Tutorial
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]
 
Day 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location APIDay 9: Make Your App Location Aware using Location API
Day 9: Make Your App Location Aware using Location API
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Android Services
Android ServicesAndroid Services
Android Services
 
Training android
Training androidTraining android
Training android
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through Activities
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overview
 

Similaire à Action Bar Sherlock tutorial

Action bar & ActionBarSherlock
Action bar & ActionBarSherlockAction bar & ActionBarSherlock
Action bar & ActionBarSherlockZahid Ali Shah
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...Kobkrit Viriyayudhakorn
 
Chapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barChapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barKalluri Vinay Reddy
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer ToolsWO Community
 
Chapter 2 lesson-2 styling the action bar
Chapter 2 lesson-2 styling the action barChapter 2 lesson-2 styling the action bar
Chapter 2 lesson-2 styling the action barKalluri Vinay Reddy
 
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)Haining Lee
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev introVonbo
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone developmentVonbo
 
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)Ranel Padon
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatcbeyls
 
Unit 2 - Object Navigator, Repository and ABAP Programs
Unit 2 - Object Navigator, Repository and ABAP ProgramsUnit 2 - Object Navigator, Repository and ABAP Programs
Unit 2 - Object Navigator, Repository and ABAP Programsdubon07
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comMohamed Rimzan
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps QuicklyGil Irizarry
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shintutorialsruby
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shintutorialsruby
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGMarakana Inc.
 

Similaire à Action Bar Sherlock tutorial (20)

Action bar & ActionBarSherlock
Action bar & ActionBarSherlockAction bar & ActionBarSherlock
Action bar & ActionBarSherlock
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
 
Chapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barChapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action bar
 
Readme
ReadmeReadme
Readme
 
Material Theme
Material ThemeMaterial Theme
Material Theme
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Chapter 2 lesson-2 styling the action bar
Chapter 2 lesson-2 styling the action barChapter 2 lesson-2 styling the action bar
Chapter 2 lesson-2 styling the action bar
 
Ember vs Backbone
Ember vs BackboneEmber vs Backbone
Ember vs Backbone
 
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev intro
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone development
 
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
 
Unit 2 - Object Navigator, Repository and ABAP Programs
Unit 2 - Object Navigator, Repository and ABAP ProgramsUnit 2 - Object Navigator, Repository and ABAP Programs
Unit 2 - Object Navigator, Repository and ABAP Programs
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.com
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shin
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shin
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.js
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 

Plus de Ahsanul Karim

Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:Ahsanul Karim
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIAhsanul Karim
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in BackgroundAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycleAhsanul Karim
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedAhsanul Karim
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyAhsanul Karim
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)Ahsanul Karim
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_startedAhsanul Karim
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Ahsanul Karim
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Ahsanul Karim
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedAhsanul Karim
 

Plus de Ahsanul Karim (16)

Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & Preferences
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:লেকচার ১ (ক)- শুরুর আগে:
লেকচার ১ (ক)- শুরুর আগে:
 
Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in Background
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Day 1 Android: Before Getting Started
Day 1 Android: Before Getting StartedDay 1 Android: Before Getting Started
Day 1 Android: Before Getting Started
 
Mobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete StudyMobile Banking in Bangladesh: An Incomplete Study
Mobile Banking in Bangladesh: An Incomplete Study
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
 
Introduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting StartedIntroduction to Android Development: Before Getting Started
Introduction to Android Development: Before Getting Started
 
Client-Server
Client-ServerClient-Server
Client-Server
 

Dernier

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Action Bar Sherlock tutorial

  • 2. Action Bar • The action bar is a window feature that identifies the application and user location, and provides user actions and navigation modes. • You should use the action bar in most activities that need to prominently present user actions or global navigation. • You can control the behaviors and visibility of the action bar with the ActionBar APIs, which were added in Android 3.0 (API level 11). • To use ActionBar in previous Android versions there is a Library ‘ActionBarSherlock’ which can be downloaded from http://actionbarsherlock.com/ • ActionBarSherlock supports from Android 2.0 and over.
  • 3. Using ActionBarSherlock(ABS) • To use ABS it has to be imported in eclipse and has to be an opened project. • Create a new Android project in Eclipse. • In create project window select ‘Create project from existing source’ • In the location browse to the ‘library folder’ in ABS library which was downloaded.
  • 4. Using ActionBarSherlock(ABS) • Go to the build path window of action bar project. • Under Libraries tab add jar ‘android-support- v4.jar’ which is already included in the libs folder. • Also set the build target to API 14 or higher. • Though ABS will be used with 2.0 or above it requires to be built with 4.0 or higher
  • 5. Using ActionBarSherlock(ABS) • Now create a new project in Eclipse with minimum SDK 7 and set Build target to 15.
  • 6. Using ActionBarSherlock(ABS) • Go to the project properties again and in the library section add the Previous created ‘ActionBarSherlock’ library • Since the action bar widget is very complex it requires a set of default themes. The library provides three core themes—one of which must be applied to each activity on which you want the action bar present. • In the Manifest set theme in the appication tag for all activities or or under specific Activities • ‘android:theme="@style/Theme.S herlock">’
  • 7. • Now we are ready to integrate Action Bar. • To Enable Action Bar for any activity, the Activity must extend ‘SherlockActivity’ instead of ‘Activity’ • To access ActionBar use getSupportActionBar() instead of getActionBar().
  • 8. Adding Menu in ActionBar • To add menu in ActionBar use menu like optionsMenu. • Define in the XML but Add the tag ‘showAsAction’ and set it to ‘ifRoom’
  • 9. • Now in the Activity’s onCreateOptionsMenu() use getSupportMenuInflater() to get the menu inflater and inflate the XML menu file • In the onOptionsItemSelect ed() do the necessary jobs identified menu items by ‘id‘ set in the XML file
  • 10. • Here is the result