Answers for "string to drawable android"

1

get drawable with string android java

Context context = imageView.getContext();
int id = context.getResources().getIdentifier("picture0001", "drawable", context.getPackageName());
imageView.setImageResource(id);
Posted by: Guest on June-22-2020
0

get drawable from string android

Context context = imageView.getContext();
int id = context.getResources().getIdentifier("picture0001", "drawable", context.getPackageName());
imageView.setImageResource(id);
Posted by: Guest on April-03-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language