Merge "Fix bad workaround docs in Resources.getDrawable()" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
16aaa3e535
@@ -714,12 +714,11 @@ public class Resources {
|
|||||||
* the resource ID passed here is an alias to another Drawable resource.
|
* the resource ID passed here is an alias to another Drawable resource.
|
||||||
* This means that if the density configuration of the alias resource
|
* This means that if the density configuration of the alias resource
|
||||||
* is different than the actual resource, the density of the returned
|
* is different than the actual resource, the density of the returned
|
||||||
* Drawable would be incorrect, resulting in bad scaling. To work
|
* Drawable would be incorrect, resulting in bad scaling. To work
|
||||||
* around this, you can instead retrieve the Drawable through
|
* around this, you can instead manually resolve the aliased reference
|
||||||
* {@link TypedArray#getDrawable TypedArray.getDrawable}. Use
|
* by using {@link #getValue(int, TypedValue, boolean)} and passing
|
||||||
* {@link android.content.Context#obtainStyledAttributes(int[])
|
* {@code true} for {@code resolveRefs}. The resulting
|
||||||
* Context.obtainStyledAttributes} with
|
* {@link TypedValue#resourceId} value may be passed to this method.</p>
|
||||||
* an array containing the resource ID of interest to create the TypedArray.</p>
|
|
||||||
*
|
*
|
||||||
* <p class="note"><strong>Note:</strong> To obtain a themed drawable, use
|
* <p class="note"><strong>Note:</strong> To obtain a themed drawable, use
|
||||||
* {@link android.content.Context#getDrawable(int) Context.getDrawable(int)}
|
* {@link android.content.Context#getDrawable(int) Context.getDrawable(int)}
|
||||||
|
|||||||
Reference in New Issue
Block a user