I want to set a BitMap from resources but the name of the image came in a string. How can i set it. My code now is this.
String Nombre= results.getString(0);
RelativeLayout oneLayout = (RelativeLayout)findViewById(R.id.relative1);
ImageView imageView = new ImageView(getApplicationContext());
Bitmap bMap = BitmapFactory.decodeFile("res/drawable/"+Nombre);
Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.Nombre);
imageView.setImageBitmap(bMap);
oneLayout.addView(imageView);
This line is not working i know:
Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.Nombre);
I need a form to do it, any help is wellcome