Home | History | Annotate | Download | only in extras
      1 page.title=Support Library
      2 
      3 @jd:body
      4 
      5 <div id="qv-wrapper">
      6 <div id="qv">
      7 
      8 <h2>In this document</h2>
      9 <ol>
     10   <li><a href="#Notes">Revisions</a></li>
     11   <li><a href="#Downloading">Downloading the Support Package</a></li>
     12   <li><a href="#SettingUp">Setting Up a Project to Use a Library</a></li>
     13   <li><a href="#Using">Using the v4 Library APIs</a></li>
     14   <li><a href="#Docs">Reference Docs</a></li>
     15   <li><a href="#Samples">Samples</a></li>
     16 </ol>
     17 
     18 <h2>See also</h2>
     19 <ol>
     20   <li><a
     21 href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0</a></li>
     22   <li><a href="http://code.google.com/p/iosched/">Google I/O App source code</a></li>
     23 </ol>
     24 
     25 </div>
     26 </div>
     27 
     28 <p><em>Minimum API level supported:</em> <b>4</b></p>
     29 
     30 <p>The Support Package includes static "support libraries" that you can add to your Android
     31 application in order to use APIs that are either not available for older platform versions or that
     32 offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your
     33 development by offering more APIs that you can bundle with your application so you can
     34 worry less about platform versions.</p>
     35 
     36 <p class="note"><strong>Note:</strong> The Support Package includes more than one support
     37 library. Each one has a different <em>minimum API level</em>. For example, one library requires API
     38 level 4 or higher, while another requires API level 13 or higher (v13 is a superset of v4 and
     39 includes additional
     40 support classes to work with v13 APIs). The minimum version is indicated
     41 by the directory name, such as {@code v4/} and {@code v13/}.</p>
     42 
     43 
     44 <h2 id="Notes">Revisions</h2>
     45 
     46 <p>The sections below provide notes about successive releases of
     47 the Support Package, as denoted by revision number.</p>
     48 
     49 <script type="text/javascript">
     50 function toggleDiv(link) {
     51   var toggleable = $(link).parent();
     52   if (toggleable.hasClass("closed")) {
     53     //$(".toggleme", toggleable).slideDown("fast");
     54     toggleable.removeClass("closed");
     55     toggleable.addClass("open");
     56     $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot +
     57 "assets/images/triangle-opened.png"));
     58   } else {
     59     //$(".toggleme", toggleable).slideUp("fast");
     60     toggleable.removeClass("open");
     61     toggleable.addClass("closed");
     62     $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot +
     63 "assets/images/triangle-closed.png"));
     64   }
     65   return false;
     66 }
     67 </script>
     68 
     69 <style>
     70 .toggleable {
     71 padding: 5px 0 0;
     72 }
     73 .toggleme {
     74   padding: 10px 0 0 20px;
     75 }
     76 .toggleable a {
     77   text-decoration:none;
     78 }
     79 .toggleme a {
     80   text-decoration:underline;
     81 }
     82 .toggleable.closed .toggleme {
     83   display:none;
     84 }
     85 #jd-content .toggle-img {
     86   margin:0 5px 3px 0;
     87 }
     88 </style>
     89 
     90 <div class="toggleable opened">
     91   <a href="#" onclick="return toggleDiv(this)">
     92   <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px"
     93 />Support Package, revision 10</a> <em>(August 2012)</em>
     94   <div class="toggleme">
     95     <dl>
     96       <dt>Changes for v4 support library:</dt>
     97       <dd>
     98         <ul>
     99           <li>Added support for notification features introduced in Android 4.1 (API Level 16) with
    100           additions to {@link android.support.v4.app.NotificationCompat}.</li>
    101         </ul>
    102       </dd>
    103     </dl>
    104   </div>
    105 </div>
    106 
    107 
    108 <div class="toggleable closed">
    109   <a href="#" onclick="return toggleDiv(this)">
    110   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    111 />Support Package, revision 9</a> <em>(June 2012)</em>
    112   <div class="toggleme">
    113     <dl>
    114       <dt>Changes for v4 support library:</dt>
    115       <dd>
    116         <ul>
    117 
    118           <li>User Interface Support
    119             <ul>
    120               <li>Added {@link android.support.v4.view.PagerTabStrip} support, providing enhanced
    121 functionality beyond {@link android.support.v4.view.PagerTitleStrip}.</li>
    122               <li>Fixed various bugs for {@link android.support.v4.view.PagerTitleStrip} and
    123 {@link android.support.v4.view.PagerTabStrip}, including {@link
    124 android.widget.TextView#setAllCaps setAllCaps} option, title alignment,
    125 appearance improvements, minimum width constraints and touch navigation issues.</li>
    126               <li>Added support for {@link android.support.v4.view.ViewPager} page gutters, which
    127 helps the {@link android.support.v4.view.ViewPager} class provide paging support for content with
    128 a large horizontal scroll range, such as a map.</li>
    129               <li>Fixed numerous bugs for {@link android.support.v4.view.ViewPager}, including size
    130 and data set change problems, page positioning, user interaction, scroll tracking and keyboard
    131 navigation problems.</li>
    132               <li>Fixed many bugs for {@link android.support.v4.app.Fragment}, including proper
    133 handling of {@link android.support.v4.app.Fragment#onActivityResult onActivityResult()} when
    134 the target fragment no longer exists, dispatching selection events to invisible fragments, improved
    135 {@link android.support.v4.app.FragmentTransaction#replace FragmentTransaction.replace()} behavior
    136 and added better state handling for fragments being moved out of view.</li>
    137               <li>Added support for the {@link
    138 android.support.v4.view.ViewCompat postOnAnimation()} method in {@link
    139 android.support.v4.view.ViewCompat}.</li>
    140               <li>Updated {@link android.support.v4.app.NavUtils} to use Android 4.1 (API level 16)
    141 <em>Up</em> navigation functionality when available.</li>
    142             </ul>
    143           </li>
    144 
    145           <li>Accessibility
    146             <ul>
    147               <li>Updated accessibility support classes, including {@link
    148 android.support.v4.view.accessibility.AccessibilityNodeInfoCompat}, to follow fixes made in Android
    149 4.1 (API level 16).</li>
    150               <li>Added support for accessibility scroll actions in {@link
    151 android.support.v4.view.ViewPager}.</li>
    152             </ul>
    153           </li>
    154 
    155           <li>General improvements
    156             <ul>
    157               <li>Updated {@link android.support.v4.app.TaskStackBuilder} to reflect API changes in
    158 Android 4.1 (API level 16).</li>
    159               <li>Enhanced {@link android.support.v4.app.TaskStackBuilder} to allow it to be used
    160 from a Service.</li>
    161               <li>Added support for {@link android.support.v4.content.IntentCompat EXTRA_HTML_TEXT}
    162 to {@link android.support.v4.app.ShareCompat}.</li>
    163               <li>Updated {@link android.support.v4.app.NotificationCompat.Builder} to support the
    164 {@link android.support.v4.app.NotificationCompat.Builder#setNumber setNumber()} method.</li>
    165               <li>Added support in {@link android.support.v4.net.ConnectivityManagerCompat} for the
    166 {@link android.support.v4.net.ConnectivityManagerCompat#isActiveNetworkMetered
    167 isActiveNetworkMetered()} method.</li>
    168             </ul>
    169           </li>
    170         </ul>
    171       </dd>
    172     </dl>
    173   </div>
    174 </div>
    175 
    176 <div class="toggleable closed">
    177   <a href="#" onclick="return toggleDiv(this)">
    178   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    179 />Support Package, revision 8</a> <em>(April 2012)</em>
    180   <div class="toggleme">
    181     <dl>
    182       <dt>Changes for v4 support library:</dt>
    183       <dd>
    184         <ul>
    185           <li>Fixed intent flags for {@link android.app.PendingIntent} objects generated
    186             by {@link android.support.v4.app.TaskStackBuilder}.</li>
    187           <li>Removed unused attributes from the gridlayout library projects to make sure
    188             the library can be built with API Level 7 and higher.</li>
    189           <li>Added {@code .classpath} and {@code .project} files for the gridlayout
    190             library project.</li>
    191         </ul>
    192       </dd>
    193     </dl>
    194   </div>
    195 </div>
    196 
    197 <div class="toggleable closed">
    198   <a href="#" onclick="return toggleDiv(this)">
    199   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    200 />Support Package, revision 7</a> <em>(March 2012)</em>
    201   <div class="toggleme">
    202     <dl>
    203       <dt>Changes for v4 support library:</dt>
    204       <dd>
    205         <ul>
    206           <li>Added {@link android.support.v4.app.ShareCompat}, which provides helper classes
    207 for sending and receiving content for social sharing applications, including new metadata for
    208 attributing shared data to the source app. This class also provides compatible integration with the
    209 new {@link android.widget.ShareActionProvider} in Android 4.0.</li>
    210           <li>Added {@link android.support.v4.app.NavUtils} and {@link
    211 android.support.v4.app.TaskStackBuilder} to provide support for implementing the
    212 <a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These 
    213 additions include a way to implement the action bar's <em>Up</em> button across versions.
    214 For an example implementation of this pattern, see the AppNavigation sample in
    215 ({@code <em>&lt;sdk&gt;</em>/samples/<em>&lt;platform&gt;</em>/AppNavigation}).</li>
    216           <li>Added {@link android.support.v4.app.NotificationCompat.Builder} to provide a
    217 compatibility implementation of Android 3.0's {@link android.app.Notification.Builder} helper class
    218 for creating standardized system notifications.</li>
    219         </ul>
    220       </dd>
    221     </dl>
    222   </div>
    223 </div>
    224 
    225 <div class="toggleable closed">
    226   <a href="#" onclick="return toggleDiv(this)">
    227   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    228 />Support Package, revision 6</a> <em>(December 2011)</em>
    229   <div class="toggleme">
    230 
    231     <p class="note"><strong>Note:</strong> Reference for support library APIs are now available with
    232     the framework references, for example: {@link android.support.v4.app}.</p>
    233 <dl>
    234       <dt>Changes for v4 support library:</dt>
    235       <dd>
    236         <ul>
    237           <li>Changes to ViewPager:
    238             <ul>
    239               <li>Added extra decorative view support for {@link android.support.v4.view.ViewPager}.
    240                 Decorative views may be supplied as child views of a pager in XML layout.</li>
    241               <li>Added {@link android.support.v4.view.PagerAdapter#getPageTitle
    242                 PagerAdapter.getPageTitle()} to supply title strings for pages, which defaults to no
    243                 title for each page.</li>
    244               <li>Added {@link android.support.v4.view.PagerTitleStrip}, a non-interactive title
    245                 strip, that can be added as a child of ViewPager. Developers can supply text
    246                 appearance and color, as well as layout sizing and gravity information.</li>
    247               <li>Updated {@link android.support.v4.view.PagerAdapter} methods to take ViewGroup
    248                 objects, rather than View to avoid class casting in adapter implementations.</li>
    249               <li>Updated {@link android.support.v4.view.ViewPager} to use Launcher-style
    250                 fling behavior.</li>
    251               <li>Bug fixes for user interface interaction and test automation.</li>
    252             </ul>
    253           </li>
    254 
    255           <li>Support for Fragments:
    256             <ul>
    257               <li>Changed {@code setStartDeferred()} method to {@link
    258                 android.support.v4.app.Fragment#setUserVisibleHint}.</li>
    259               <li>Added deferred start for off-screen pages to improve performance.</li>
    260             </ul>
    261           </li>
    262 
    263           <li>Support for Accessiblity APIs:
    264             <ul>
    265               <li>Updated {@link android.support.v4.view.AccessibilityDelegateCompat} methods
    266                 to return empty lists instead of null.</li>
    267               <li>Added new APIs needed by the v4 samples.</li>
    268             </ul>
    269           </li>
    270 
    271         </ul>
    272       </dd>
    273     </dl>
    274   </div>
    275 </div>
    276 
    277 <div class="toggleable closed">
    278   <a href="#" onclick="return toggleDiv(this)">
    279   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    280 />Support Package, revision 5</a> <em>(December 2011)</em>
    281   <div class="toggleme">
    282     <dl>
    283       <dt>Changes for v4 support library:</dt>
    284       <dd>
    285         <ul>
    286           <li>Support for Accessiblity APIs:
    287             <ul>
    288               <li>Added {@link android.support.v4.view.AccessibilityDelegateCompat}
    289               to support {@link android.view.View.AccessibilityDelegate}.</li>
    290 
    291               <li>Added {@link android.support.v4.view.accessibility.AccessibilityEventCompat}
    292               to support {@link android.view.accessibility.AccessibilityEvent}.</li>
    293 
    294               <li>Added {@link android.support.v4.view.accessibility.AccessibilityManagerCompat}
    295               to support {@link android.view.accessibility.AccessibilityManager}.</li>
    296 
    297               <li>Added {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat}
    298               to support {@link android.view.accessibility.AccessibilityNodeInfo}.</li>
    299 
    300               <li>Added {@link android.support.v4.view.accessibility.AccessibilityRecordCompat}
    301               to support {@link android.view.accessibility.AccessibilityRecord}.</li>
    302 
    303               <li>Added {@link
    304               android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat}
    305               to support {@link android.accessibilityservice.AccessibilityServiceInfo}.</li>
    306 
    307               <li>Added {@link android.support.v4.view.ViewGroupCompat}
    308               to support accessibility features in {@link android.view.ViewGroup}.
    309               </li>
    310 
    311               <li>Modified {@link android.support.v4.view.ViewCompat}
    312               to support accessibility features in {@link android.view.View}.</li>
    313             </ul>
    314           </li>
    315 
    316           <li>Changes to ViewPager:
    317             <ul>
    318               <li>Added support for margins between pages.
    319               An optional {@link android.graphics.drawable.Drawable} can be provided
    320               to fill the margins.</li>
    321               <li>Added support for {@link android.widget.EdgeEffect}.</li>
    322               <li>Added support for keyboard navigation</li>
    323               <li>Added support to control how many pages are kept to either side
    324               of the current page.</li>
    325               <li>Improved touch physics.</li>
    326               <li>Bug fixes for user interface behavior.</li>
    327             </ul>
    328           </li>
    329         </ul>
    330       </dd>
    331     </dl>
    332   </div>
    333 </div>
    334 
    335 <div class="toggleable closed">
    336   <a href="#" onclick="return toggleDiv(this)">
    337   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    338 />Support Package, revision 4</a> <em>(October 2011)</em>
    339   <div class="toggleme">
    340     <dl>
    341       <dt>Changes for v4 support library:</dt>
    342       <dd>
    343         <ul>
    344           <li>Added <code>EdgeEffectCompat</code> to
    345           support {@link android.widget.EdgeEffect}.</li>
    346 
    347           <li>Added <code>LocalBroadcastManager</code> to allow applications to easily
    348             register for and receive intents within a single application without
    349             broadcasting them globally.</li>
    350 
    351           <li>Added support in <code>ViewCompat</code> to check for and set overscroll
    352           modes for {@link android.view.View}s on Android 2.3 and later.</li>
    353           <li>Changes to Fragment APIs:
    354             <ul>
    355               <li>Added new APIs to control the visibility of new menus.</li>
    356               <li>Added custom animation APIs.</li>
    357               <li>Added APIs in <code>FragmentActivity</code> to retain custom,
    358               non-configuration instance data.</li>
    359               <li>Various bug fixes.</li>
    360             </ul>
    361           </li>
    362 
    363           <li>Fixed a {@link android.content.Loader} bug that caused issues in
    364           canceling {@link android.os.AsyncTask}s when running on Froyo and older
    365           versions of the platform. The support
    366           code now uses its own version of {@link android.os.AsyncTask} to keep the same
    367           behavior on all platform versions.</li>
    368 
    369         </ul>
    370       </dd>
    371     </dl>
    372   </div>
    373 </div>
    374 
    375 
    376 <div class="toggleable closed">
    377   <a href="#" onclick="return toggleDiv(this)">
    378   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    379 />Compatibility Package, revision 3</a> <em>(July 2011)</em>
    380   <div class="toggleme">
    381     <dl>
    382       <dt>Changes for v4 support library:</dt>
    383       <dd>
    384         <ul>
    385           <li>Adds support for {@link android.app.Fragment.SavedState}</li>
    386           <li>Adds {@code MotionEventCompat} to support newer {@link
    387 android.view.MotionEvent} APIs</li>
    388           <li>Adds {@code VelocityTrackerCompat} to support a newer {@link
    389 android.view.VelocityTracker} APIs</li>
    390           <li>Adds {@code ViewConfigurationCompat} to support a newer {@link
    391 android.view.ViewConfiguration} APIs</li>
    392           <li>All new APIs (available only in the support library) that allow you to create UIs
    393 with horizontal paging, allowing users to swipe left and right between content views. Classes to
    394 support this include:
    395             <ul>
    396               <li>{@code ViewPager}: A {@link android.view.ViewGroup} that manages the
    397 layout for the child views, which the user can swipe between.</li>
    398               <li>{@code PagerAdapter}: An adapter that populates the {@code ViewPager} with the
    399 views that represent each page.</li>
    400               <li>{@code FragmentPagerAdapter}: An extension of {@code PagerAdapter} for flipping
    401 between fragments.</li>
    402               <li>{@code FragmentStatePagerAdapter}: An extension of {@code PagerAdapter} for
    403 flipping between fragments that uses the library's support for {@link
    404 android.app.Fragment.SavedState}.</li>
    405             </ul>
    406           </li>
    407         </ul>
    408       </dd>
    409       <dt>New v13 support library:</dt>
    410       <dd>
    411         <ul>
    412           <li>Includes the {@code FragmentPagerAdapter} and {@code FragmentStatePagerAdapter}
    413 to support the horizontal paging.
    414           <p>These are exactly the same as the APIs added to the v4 support library, but rely on
    415 other platform components in Android 3.2. Use this library instead of v4 if you're developing for
    416 Android 3.2 and higher (all other APIs in the v4 library are already available with API level
    417 13).</p>
    418           </li>
    419         </ul>
    420       </dd>
    421     </dl>
    422   </div>
    423 </div>
    424 
    425 
    426 <div class="toggleable closed">
    427   <a href="#" onclick="return toggleDiv(this)">
    428   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    429 />Compatibility Package, revision 2</a> <em>(May 2011)</em>
    430   <div class="toggleme">
    431     <dl>
    432     <dt>Changes for v4 library:</dt>
    433     <dd>
    434       <ul>
    435         <li>Support for fragment animations</li>
    436         <li>Fix {@code android.support.v4.app.Fragment#onActivityResult Fragment.onActivityResult()}
    437           bug</li>
    438       </ul>
    439     </dd>
    440     </dl>
    441   </div>
    442 </div>
    443 
    444 
    445 <div class="toggleable closed">
    446   <a href="#" onclick="return toggleDiv(this)">
    447   <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px"
    448 />Compatibility Package, revision 1</a> <em>(March 2011)</em>
    449   <div class="toggleme">
    450       <p>Initial release with the v4 library.</p>
    451   </div>
    452 </div>
    453 
    454 
    455 
    456 <h2 id="Downloading">Downloading the Support Package</h2>
    457 
    458 <p>The Support Package is provided as a downloadable package from the Android SDK
    459 Manager. To install:</p>
    460 
    461 <ol>
    462   <li>Launch the Android SDK Manager.
    463     <p>From Eclipse, you can select <strong>Window</strong>
    464 &gt; <strong>Android SDK Manager</strong>. Or, launch {@code SDK Manager.exe} from
    465 the {@code &lt;sdk&gt;/} directory (on Windows only) or {@code android} from the {@code
    466 &lt;sdk&gt;/tools/} directory.</p></li>
    467   <li>Expand the Android Repository, check <strong>Android Support package</strong>
    468 and click <strong>Install selected</strong>.</li>
    469   <li>Proceed to install the package.</li>
    470 </ol>
    471 
    472 <p>When done, all files (including source code, samples, and the {@code .jar} files) are saved
    473 into the <code>&lt;sdk&gt;/extras/android/support/</code> directory. This directory contains
    474 each of the different support libraries, such as the library for API level 4 and up and the library
    475 for API level 13 and up, each named with the respective version (such as {@code v4/}).</p>
    476 
    477 
    478 <h2 id="SettingUp">Setting Up a Project to Use a Library</h2>
    479 
    480 <p>To add one of the libraries to your Android project:</p>
    481 <ol>
    482   <li>In your Android project, create a directory named {@code libs} at the root of your
    483 project (next to {@code src/}, {@code res/}, etc.)</li>
    484   <li>Locate the JAR file for the library you want to use and copy it into the {@code
    485 libs/} directory.
    486     <p>For example, the library that supports API level 4 and up is located at {@code
    487 &lt;sdk&gt;/extras/android/support/v4/android-support-v4.jar}.</p>
    488   </li>
    489   <li>Add the JAR to your project build path.
    490     <p>In Eclipse, right-click the JAR file in the Package Explorer, select <strong>Build
    491 Path</strong> &gt; <strong>Add to Build Path</strong>.</p>
    492   </li>
    493 </ol>
    494 
    495 <p>Your application is now ready to use the library APIs. All the
    496 provided APIs are available in the {@code android.support} package (for
    497 example, {@code android.support.v4}).</p>
    498 
    499 <p class="note"><strong>Tip:</strong> To see the library APIs in action, take a look at the sample
    500 apps in {@code &lt;sdk&gt;/extras/android/support/&lt;version&gt;/samples/}.</p>
    501 
    502 <p class="warning"><strong>Warning:</strong> Be certain that you not confuse the standard
    503 {@code android} packages with those in {@code android.support} library. Some code completion tools
    504 might
    505 get this wrong, especially if you're building against recent versions of the platform. To be safe,
    506 keep your build target set to the same version as you have defined for your <a
    507 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a>
    508 and double check the import statements for classes that also exist in the support library, such as
    509 {@code SimpleCursorAdapter}.</p>
    510 
    511 
    512 <h2 id="Using">Using the v4 Library APIs</h2>
    513 
    514 <p>The support library for v4 provides access to several classes introduced with Android 3.0 and
    515 beyond, plus some updated version of existing classes, and even some APIs that currently don't
    516 exist in the Android platform. Some of the most useful and notable classes that have
    517 counterparts in the v4 support library are:</p>
    518 
    519 <ul>
    520   <li>{@link android.app.Fragment}</li>
    521   <li>{@link android.app.FragmentManager}</li>
    522   <li>{@link android.app.FragmentTransaction}</li>
    523   <li>{@link android.app.ListFragment}</li>
    524   <li>{@link android.app.DialogFragment}</li>
    525   <li>{@link android.app.LoaderManager}</li>
    526   <li>{@link android.content.Loader}</li>
    527   <li>{@link android.content.AsyncTaskLoader}</li>
    528   <li>{@link android.content.CursorLoader}</li>
    529 </ul>
    530 
    531 <p>For each of the classes above (and others not listed), the APIs work almost exactly the same
    532 as the counterparts in the latest Android platform. Thus, you can usually refer to
    533 the online documentation for information about the supported APIs. There are some
    534 differences, however. Most notably:</p>
    535 
    536 <ul>
    537   <li>When creating an activity to use fragments, you must declare your activity to extend the
    538 {@link android.support.v4.app.FragmentActivity} class (instead of the traditional
    539 {@link android.app.Activity} class).</li>
    540   <li>To manage your fragments and loaders, you must use the methods
    541   {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager
    542   FragmentActivity.getSupportFragmentManager()} and
    543   {@link android.support.v4.app.FragmentActivity#getSupportLoaderManager
    544   FragmentActivity.getSupportLoaderManager()} (instead of the
    545   {@link android.app.Activity#getFragmentManager()} and
    546   {@link android.app.Activity#getLoaderManager()} methods).</li>
    547   <li>The {@link android.app.ActionBar} is <strong>not supported</strong> by the library.
    548 However, when creating your <a href="{@docRoot}guide/topics/ui/menus.html#options-menu">Options
    549 Menu</a>, you can declare which items should be added to the Action Bar when it's available (on
    550 Android 3.0 or later). You can do so with the
    551 {@link android.support.v4.view.MenuCompat#setShowAsAction MenuCompat.setShowAsAction()} method, for
    552 example:
    553 <pre>
    554 public boolean onCreateOptionsMenu(Menu menu) {
    555     MenuInflater inflater = getMenuInflater();
    556     inflater.inflate(R.menu.options, menu);
    557     MenuCompat.setShowAsAction(menu.findItem(R.id.action_search), 1);
    558     return true;
    559 }
    560 </pre>
    561 <p>Also see the <a href="{@docRoot}resources/samples/ActionBarCompat/index.html">Action Bar
    562 Compatibility</a> sample for a demonstration of how to use {@link android.app.ActionBar} on Android
    563 3.0+ and also support action bar functionality on older versions.</p>
    564 </li>
    565 </ul>
    566 
    567 <div class="note"><p><strong>Tip:</strong> To enable the Holographic theme on devices
    568 running Android 3.0 or higher, declare in your manifest file that your application targets
    569 API level 11, for example:</p>
    570 <pre>
    571 &lt;uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /&gt;
    572 </pre>
    573 <p>This way, your application automatically receives the Holographic theme and the Action Bar for
    574 each activity when running on Android 3.0 and higher.</p>
    575 </div>
    576 
    577 <p>For more information about how you can optimize your application for the latest
    578 Android-powered devices, read <a href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing
    579 Apps for Android 3.0</a>.</p>
    580 
    581 
    582 <h2 id="Docs">Reference Docs</h2>
    583 
    584 <p>The reference documentation for the Support Packages is included as part of the Android
    585 online developer documentation:</p>
    586 
    587 <ul>
    588   <li><a href="{@docRoot}reference/android/support/v4/app/package-summary.html">Support Package
    589     API 4 Reference</a></li>
    590   <li><a href="{@docRoot}reference/android/support/v13/app/package-summary.html">Support Package
    591     API 13 Reference</a></li>
    592 </ul>
    593 
    594 
    595 <h2 id="Samples">Samples</h2>
    596 
    597 <p>If you want to see some code that uses the support libraries, samples are included with the
    598 Support Package, inside each support library directory, for example; {@code
    599 &lt;sdk&gt;/extras/android/support/v4/samples/}. You can also view these samples as part of the
    600 Android online developer documentation:</p>
    601 
    602 <ul>
    603   <li><a href="{@docRoot}resources/samples/Support4Demos/index.html">Support API 4 Demos</a></li>
    604   <li><a href="{@docRoot}resources/samples/Support13Demos/index.html">Support API 13 Demos</a></li>
    605 </ul>
    606 
    607 <p>Additionally, the <a href="http://code.google.com/p/iosched/">Google I/O App</a> is a complete
    608 application that uses the v4 support library to provide a single APK for both handsets and tablets
    609 and also demonstrates some of Android's best practices in Android UI design.</p>
    610 
    611