Useful notes & manuals
from the
world wide web
L:
P:
Register now!
Accessing resource by variable Android
Solution from: http://stackoverflow.com/questions/3218520/how-can-i-access-an-android-drawable-by-a-variable Created by tlw on 10.02.2025 @ 12:17

Explaining how to access any resource by variable, not directly. Example with "drawables".

String icon="logo" + cnt;
int resID = getResources().getIdentifier(icon, "drawable", getPackageName());
logo.setImageResource(resID);

resources   access   drawables   variable   dynamic
 
Created by THE LOST WEB © 2009-2012