summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Makoto Onuki <omakoto@google.com> 2016-11-11 23:54:51 +0000
committer android-build-merger <android-build-merger@google.com> 2016-11-11 23:54:51 +0000
commit890a14d3995941e0dbde82b867e8952fbcc18dfe (patch)
tree80f9ff7231e5644a89a6492e64def2488a90d7d8
parent1f278cd3edbae48342af25e77ab29ab0c70a59dd (diff)
parent7e1b835a4e7f3e8d29b1c294cbbd2ca1eeb2cfbf (diff)
App Shortcut: Clarify which attributes must be resources am: 104f805337 am: 2a3fe7d979 am: b0fd5ba122
am: 7e1b835a4e Change-Id: I767dcbe980a60af1a3076acdf9234f4241ab7ca1
-rw-r--r--core/java/android/content/pm/ShortcutManager.java21
-rw-r--r--docs/html/guide/topics/ui/settings.jd4
2 files changed, 20 insertions, 5 deletions
diff --git a/core/java/android/content/pm/ShortcutManager.java b/core/java/android/content/pm/ShortcutManager.java
index a93870ece823..f7c4d592b3a9 100644
--- a/core/java/android/content/pm/ShortcutManager.java
+++ b/core/java/android/content/pm/ShortcutManager.java
@@ -193,7 +193,11 @@ import java.util.List;
* The following list includes descriptions for the different attributes within a static shortcut:
* <dl>
* <dt>{@code android:shortcutId}</dt>
- * <dd>Mandatory shortcut ID</dd>
+ * <dd>Mandatory shortcut ID.
+ * <p>
+ * This must be a string literal.
+ * A resource string, such as <code>@string/foo</code>, cannot be used.
+ * </dd>
*
* <dt>{@code android:enabled}</dt>
* <dd>Default is {@code true}. Can be set to {@code false} in order
@@ -206,15 +210,24 @@ import java.util.List;
*
* <dt>{@code android:shortcutShortLabel}</dt>
* <dd>Mandatory shortcut short label.
- * See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}.</dd>
+ * See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}.
+ * <p>
+ * This must be a resource string, such as <code>@string/shortcut_label</code>.
+ * </dd>
*
* <dt>{@code android:shortcutLongLabel}</dt>
* <dd>Shortcut long label.
- * See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}.</dd>
+ * See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}.
+ * <p>
+ * This must be a resource string, such as <code>@string/shortcut_long_label</code>.
+ * </dd>
*
* <dt>{@code android:shortcutDisabledMessage}</dt>
* <dd>When {@code android:enabled} is set to
- * {@code false}, this attribute is used to display a custom disabled message.</dd>
+ * {@code false}, this attribute is used to display a custom disabled message.
+ * <p>
+ * This must be a resource string, such as <code>@string/shortcut_disabled_message</code>.
+ * </dd>
*
* <dt>{@code intent}</dt>
* <dd>Intent to launch when the user selects the shortcut.
diff --git a/docs/html/guide/topics/ui/settings.jd b/docs/html/guide/topics/ui/settings.jd
index 619fd268aef9..b51e6d97ae0a 100644
--- a/docs/html/guide/topics/ui/settings.jd
+++ b/docs/html/guide/topics/ui/settings.jd
@@ -390,7 +390,9 @@ setComponent()} method.</dd>
<dd>The package part of the component name, as per the {@link
android.content.Intent#setComponent setComponent()} method.</dd>
</dl>
-
+<p class="note"><strong>Note: </strong>You must use string literals as the values for these
+intent attributes. You cannot use resource strings, such as <code>@string/foo</code>, to define the attributes.
+</p>
<h2 id="Activity">Creating a Preference Activity</h2>