开发者

can BitmapFactory.decodeResource(context,int) take context string

开发者 https://www.devze.com 2023-02-06 17:02 出处:网络
I have a method that returns a String(let\'s say the var sprite) and this string is the name of my bitmap img,and 开发者_JAVA技巧i want to use it with BitmapFactory.decodeResource() but i don\'t know

I have a method that returns a String(let's say the var sprite) and this string is the name of my bitmap img,and 开发者_JAVA技巧i want to use it with BitmapFactory.decodeResource() but i don't know how to combine this since it must be int R.drawable.sprite

Can this be done?


Yes, it's possible. Take a look at this question:

Android and getting a view with id cast as a string

0

精彩评论

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