I’d like to ask if it’s possible and how to simplify following code:
views.setImageViewBitmap(R.id.contact01Button, data.get(0).getFriendImage());
views.setImageViewBitmap(R.id.contact02Button, data.get(1).getFriendImage());
views.setImageViewBitmap(R.id.contact03Button, data.get(2).getFriendImage());
views.setImageViewBitmap(R.id.contact04Button, data.get(3).getFriendImage());
How to generate view id e.g. R.id.contactXXButton in a cycle or with something similar? I need to set many buttons.
This should do the trick: