Professional Documents
Culture Documents
SAD Lecture 04
SAD Lecture 04
https://developer.android.com/guide/topics/ui/menus.html
Action
Bar
Action bar: top-level menu of app functions
• replaces older "Menu" button
(which is now discouraged in Android3+)
• identifies current activity/app to user
• make common actions prominent and
available
• make less common actions available
through a drop-down menu
https://developer.android.com/guide/topics/ui/actionbar.html
Support for
Action Bar
• make activity class extend AppCompatActivity
– write methods: onCreateOptionsMenu,
onOptionsItemSelected
• handle events
– write code in onOptionsItemSelected to check what option was
clicked and respond accordingly
Making Menu in
AppCompatActivity
Making Menu in
AppCompatActivity (Cont…)
Defining a Menu in XML
• Using a menu resource is a good practice for a few
reasons:
– It's easier to visualize the menu structure in XML.
– It separates the content for the menu from your
application's behavioral code.
– It allows you to create alternative menu configurations for
different platform versions, screen sizes, and other
configurations by leveraging the app resources framework.
Defining a Menu in XML
(Cont...)
Solution to Menu with Icons and
Text items
Rating Bar
(link)
A RatingBar is an extension of SeekBar and ProgressBar that
shows a rating in stars.
https://developer.android.com/reference/android/widget/RatingBar.html
Ideas...!!
!
History Venture
Idea??
Idea??
Think!!
Idea?? Education
Silicon Valley
Module
Idea??
#Tag #Tag Idea??
Hangouts
Idea??
Idea??
Moasure – the smart tape
measure
Topics Covered
– http://developer.android.com/guide/topics
(mentioned in slides)
Any Question?