I have many Images and I would like to write a short-code I just want to change the image name at the runtime and the code should insert the Picture in the correct image I Try like that :
img1 = (ImageView) findViewById(R.id.imageView_1);
img2 = (ImageView) findViewById(R.id.imageView_2);
img3 = (ImageView) findViewById(R.id.imageView_3);
img4 = (ImageView) findViewById(R.id.imageView_4); }
public void Load_IN_img1(View view) {
image_x="img1";
Picasso.with(Main.this).load("http://blabla.comimage1.png").into(image_x);
public void Load_IN_img1(View view) {
image_x="img2";
Picasso.with(Main.this).load("http://blabla.comimage1.png").into(image_x);
that means, if i change the string image_x to "img4" so the code should insert the Picture in the wanted image, into img4.
How can I find the image-name at runtime ?