Say I have a loop that creates ImageViews and adds them to a layout
final LinearLayout linLayRow1 = (LinearLayout) findViewById(R.id.LLrow1);
...
try {
FileInputStream in1 = new FileInputStream(masterPath+shiftimage);
BufferedInputStream buf1 = new BufferedInputStream(in1);
Bitmap bMap1 = BitmapFactory.decodeStream(buf1);
ivBtnSym.setImageBitmap(bMap1);
in1.close();
buf1.close();
} catch (Exception e) { }
...
linLayBtnInside.addView(ivBtnSym);
And now I’d need to change the bitmap of an ImageView that is, for example, masterPath+”/1.png” to masterPath+”/2.png” … how would you do that?
Thanks! 🙂
If you are sure that the image names are unique
You could try to use tags:
Now when you want to retrieve the ImageView: