logo "R.drawable.logo" (a String), int. R.drawable.logo static int logo static class drawable, R. R - , gen.
. , , - :
String logoParts [] = logo.split ("\\.");
int logoId = getResources ().getIdentifier (logoParts [logoParts.length - 1], "drawable", "com.example.app");
:
public static int parseResourceString (Stinrg resString, String package) {
String resParts [] = resString.split ("\\.");
return getResources ().getIdentifier (resParts [resParts.length - 1], resParts [resParts.length - 2], package);
}