0

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 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?

stelios
  • 1,027
  • 3
  • 14
  • 19

1 Answers1

2

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

Android and getting a view with id cast as a string

Community
  • 1
  • 1
Cristian
  • 198,401
  • 62
  • 356
  • 264