Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 440472c9 authored by Kevin Hufnagle's avatar Kevin Hufnagle Committed by android-build-merger
Browse files

Merge "docs: Added section describing Launcher Shortcuts." into mnc-mr-docs am: 9d4afa9c

am: ecb81647

* commit 'ecb81647':
  docs: Added section describing Launcher Shortcuts.

Change-Id: If868f090f05120d523fa08f4029c9041c89ae307
parents 44b5c3f3 ecb81647
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ page.image=images/cards/card-n-apis_2x.png
        <li><a href="#default_trusted_ca">Default Trusted CA</a></li>
        <li><a href="apk_signature_v2">APK signature scheme v2</a></li>
        <li><a href="#scoped_directory_access">Scoped directory access</a></li>
        <li><a href="#launcher_shortcuts">Launcher shortcuts</a></li>
      </ol>
</div>
</div>
@@ -696,8 +697,57 @@ requesting access to.</p>
<a href="{@docRoot}preview/features/scoped-folder-access.html">Scoped
Directory Access</a> developer documentation.</p>

<h2 id="launcher_shortcuts">
  Launcher shortcuts
</h2>

<p>
  Android N allows apps to define action-specific shortcuts which can be
  displayed in the launcher. These <em>launcher shortcuts</em> let your users
  quickly start common or recommended tasks within your app. Each shortcut
  contains an <a href=
  "{@docRoot}guide/components/intents-filters.html">intent</a>, which links the
  shortcut to a specific action in your app. Examples of these actions include:
</p>

<ul>
  <li>Navigating users to a particular location in a mapping app.
  </li>

  <li>Sending messages to a friend in a communication app.
  </li>

  <li>Playing the next episode of a TV show in a media app.
  </li>

  <li>Loading the last save point in a gaming app.
  </li>
</ul>

<p>
  Your app can create up to five <em>dynamic shortcuts</em>. When users perform
  a gesture over your app's launcher icon, these shortcuts appear. By dragging
  the shortcuts onto the launcher, users can make persistent copies of the
  shortcuts, called <em>pinned shortcuts</em>. Users can create an unlimited
  number of pinned shortcuts for each app.
</p>

<p class="note">
  <strong>Note:</strong> Although other apps can't access your shortcut data,
  the launcher <strong>does</strong> have access to this data. Therefore, the
  shortcuts you create should conceal sensitive user information.
</p>

<p>
  You can use this command to view your app's shortcuts:
</p>

<pre class="no-pretty-print">
$ adb shell dumpsys shortcut
</pre>
<p>
  To update all shortcuts and to delete dynamic shortcuts, use the appropriate
  methods that the Launcher Shortcut API provides. For more details about this
  API, see <code>android.content.pm.ShortcutManager</code> in the downloadable
  <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
</p>