开发者

OutOfMemory in Android

开发者 https://www.devze.com 2023-02-03 15:49 出处:网络
In the solution for out of memory: Strange out of memory issue while loading an image to a Bitmap object, it talks about using: decodeFile(File f). How do you handle开发者_运维百科 internal image file

In the solution for out of memory: Strange out of memory issue while loading an image to a Bitmap object, it talks about using: decodeFile(File f). How do you handle开发者_运维百科 internal image files that are referred to as R.id.something? these resources are seen as integers?


You can use decodeResource():

Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage);

or

Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage,options);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号