1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2013 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<sample>
18    <name>ActionBarCompat-Basic</name>
19    <group>UI</group>
20    <package>com.example.android.actionbarcompat.basic</package>
21
22    <!-- change minSdk if needed-->
23    <minSdk>14</minSdk>
24
25    <strings>
26        <intro>
27            <![CDATA[
28            This sample shows you how to use ActionBarCompat to create a basic Activity which
29            displays action items. It covers inflating items from a menu resource, as well as adding
30            an item in code. Items that are not shown as action items on the Action Bar are
31            displayed in the action bar overflow.
32            ]]>
33        </intro>
34    </strings>
35
36    <template src="base"/>
37
38<metadata>
39    <status>PUBLISHED</status>
40    <categories>Getting Started, UI</categories>
41    <technologies>Android</technologies>
42    <languages>Java</languages>
43    <solutions>Mobile</solutions>
44    <level>BEGINNER</level>
45    <!-- Dimensions: 512x512, PNG fomrat -->
46    <icon>screenshots/big-icon.png</icon>
47    <!-- Path to screenshots. Use <img> tags for each. -->
48    <screenshots>
49        <img>screenshots/screenshot1.png</img>
50        <img>screenshots/screenshot2.png</img>
51    </screenshots>
52    <!-- List of APIs that this sample should be cross-referenced under. Use <android>
53    for fully-qualified Framework class names ("android:" namespace).
54
55    Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation
56    for more details. -->
57    <api_refs>
58        <android>android.app.ActionBar</android>
59        <android>android.support.v7.app.AppCompatActivity</android>
60        <android>android.support.v4.view.MenuItemCompat</android>
61    </api_refs>
62    <description>
63<![CDATA[
64This sample shows you how to use ActionBarCompat to create a basic Activity
65which displays action items. It covers inflating items from a menu resource,
66as well as adding an item in code.
67]]>
68    </description>
69    <intro>
70<![CDATA[
71Android 3.0 introduced the “action bar” control, a toolbar that is expected
72to be present in most types of applications. This control identifies the user
73location, and provides user actions and navigation modes.
74Using the action bar offers your users a familiar interface across applications
75that the system gracefully adapts for different screen configurations.
76
77Instantiating an action bar can be done by using the [ActionBar][1] API provided
78in API 11 or above. Support for older devices is provided by the
79[support library’s ActionBar][2] implementation, compatible back to API 7.
80This sample demonstrates using the support library APIs.
81
82Using an ActionBar with the support library requires the following steps:
83
841. Create your activity by extending AppCompatActivity.
852. Use (or extend) one of the Theme.AppCompat themes for your activity.
86
87Once this is done, action items will be created for any options menu items that
88would otherwise be created during when `[onCreateOptionsMenu()][3]` is called.
89
90[1]: http://developer.android.com/reference/android/app/ActionBar.html
91[2]: http://developer.android.com/reference/android/support/v7/app/ActionBar.html
92[3]: http://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu)
93]]>
94    </intro>
95</metadata>
96</sample>
97