I use decodeResource(String res);

On 4 июн, 13:28, Steve Oldmeadow <[EMAIL PROTECTED]> wrote:
> On Jun 4, 5:54 pm, reznic <[EMAIL PROTECTED]> wrote:
>
> > I try to load image from:
> > res/drawable/icon.png
> > Bitmap bitmap = BitmapFactory.decodeFile("res/drawable/icon.png");
> > result: bitmap is null
> > why?
>
> Because you passed in an invalid path.
>
> If you put the image under res/drawable then you use the
> decodeResource(Resources res, int id) method.  You get the resource id
> from you R class which is automatically generated by the development
> environment.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to