Android Tips, Techniques and Theory
PART 1: Creating Content with XML with Android Studio (No programming required)
With Simple Recipes
Go Back To TOC
Navigation
There are a variety of ways to navigate in an app.
Action Bar
Action Bar was introduced with Honeycomb. And like Fragments, it is backward compatible for Android 2.2 and above via a Support Library. It can show the user location across apps and can include:
- App's title bar and app's icon
- Action icons that are used for common actions (e.g., search)
- Action overflow icon that are used for the least so that the action bar is not clutter.
In many cases the action bar is AUTOMATICALLY created for you when you select most templates. The action bar menu items are stored in a menu's XML file.
[REPLACE WITH MY OWN GRAPHICS WHEN I COMPLETE A DEMO]

[TYPE THE FOLLWING CODE AND DELETE IMAGES AND REFERENCES]

NOTE: Notice there are android, app and tools namespaces.
In the <item> element represent each item in a menu and can have the following attributes:
- id - similar to id of view component layouts that allow access to it from the java code.
- title - a string title to be shown for menu item. The string may not be shown by default if an icon is assigned
- icon - an icon that will be shown (not in screenhshot above). The icon may nto be shown if the string is being shown if the item is being shown in the overflow menu
- orderInCategory - an integer that is used to order items in a menu when needed
- showAsAction - when and how each item should appear in the Action Bar:
- never - never place this item in Action Bar
- if room - only place item in Action Bar if there is room. If not religate it to the overflow menu
- with text - include title text with icon
- always - always place this item in Action Bar. Should be avoid if you have multiple items with this attributes which can cause the Action Bar to overlap icons.
- collapseActionView - the item can be collapse
[TYPE THE FOLLWING CODE AND DELETE IMAGE AND REFERENCE]

[TYPE THE FOLLWING CODE AND DELETE IMAGE AND REFERENCE]

Navigate UP should not be confuse with Navigate BACK (with Back button). Navigating up will navigate to the parent activity (akin to the home page) from the current activity . The parent activity is declared in the manifest file for each activity.

FABs
Drawers