summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alan Viverette <alanv@google.com> 2016-04-04 15:33:41 -0400
committer Alan Viverette <alanv@google.com> 2016-04-04 15:33:41 -0400
commit952802e2d1ccfd93c6640de512105f4e400ce473 (patch)
treef7755589287b6f812e6a8b874d9ece6d8f083935
parent6dffdf82857e4016c6fb953039b0508cb1fd0f71 (diff)
Fix bad workaround docs in Resources.getDrawable()
The real solution is to use ContextCompat, but we can't reference support library from framework. C'est la vie. Bug: 27727320 Change-Id: Ib9bcd5f2bdce1996f02fd44877df9ba202b26edc
-rw-r--r--core/java/android/content/res/Resources.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 387fda717e48..93fe73b06e89 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -714,12 +714,11 @@ public class Resources {
* the resource ID passed here is an alias to another Drawable resource.
* This means that if the density configuration of the alias resource
* is different than the actual resource, the density of the returned
- * Drawable would be incorrect, resulting in bad scaling. To work
- * around this, you can instead retrieve the Drawable through
- * {@link TypedArray#getDrawable TypedArray.getDrawable}. Use
- * {@link android.content.Context#obtainStyledAttributes(int[])
- * Context.obtainStyledAttributes} with
- * an array containing the resource ID of interest to create the TypedArray.</p>
+ * Drawable would be incorrect, resulting in bad scaling. To work
+ * around this, you can instead manually resolve the aliased reference
+ * by using {@link #getValue(int, TypedValue, boolean)} and passing
+ * {@code true} for {@code resolveRefs}. The resulting
+ * {@link TypedValue#resourceId} value may be passed to this method.</p>
*
* <p class="note"><strong>Note:</strong> To obtain a themed drawable, use
* {@link android.content.Context#getDrawable(int) Context.getDrawable(int)}