diff options
author | Scott Main <> | 2009-03-24 18:43:02 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 18:43:02 -0700 |
commit | e4787558f85fca4c6383a81caf6f5d07e43a1844 (patch) | |
tree | 3e0a0fa3a51df4b52fc5b43fcf4aeb56789307c4 /docs | |
parent | 95e4baf51ee38edd8a659d965a685adec24c98a9 (diff) | |
download | frameworks_base-e4787558f85fca4c6383a81caf6f5d07e43a1844.zip frameworks_base-e4787558f85fca4c6383a81caf6f5d07e43a1844.tar.gz frameworks_base-e4787558f85fca4c6383a81caf6f5d07e43a1844.tar.bz2 |
Automated import from //branches/donutburger/...@140848,140848
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/guide/topics/graphics/2d-graphics.jd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd index befb018..1f62f3d 100644 --- a/docs/html/guide/topics/graphics/2d-graphics.jd +++ b/docs/html/guide/topics/graphics/2d-graphics.jd @@ -85,7 +85,10 @@ protected void onCreate(Bundle savedInstanceState) { <p>In other cases, you may want to handle your image resource as a {@link android.graphics.drawable.Drawable} object. To do so, create a Drawable from the resource like so: -<pre>Drawable myImage = Resources.getDrawable(R.drawable.my_image);</pre> +<pre> +Resources res = mContext.getResources(); +Drawable myImage = res.getDrawable(R.drawable.my_image); +</pre> <p class="caution"><strong>Caution:</strong> Each unique resource in your project can maintain only one state, no matter how many different objects you may instantiate for it. For example, if you instantiate two |