android - How to set a bitmap from resource -


this seems simple, trying set bitmap image resources, have within application in drawable folder.

bm = bitmapfactory.decoderesource(null, r.id.image); 

is correct?

assuming calling in activity class

bitmap bm = bitmapfactory.decoderesource(getresources(), r.drawable.image); 

the first parameter, resources, required. obtainable in context (and subclasses activity).


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -