Is it possible to receive the resource-ids being kept by a as an int[] programmatically without referring to the resource-class R?
Slightly more efficient solution:
public static final int[] getResourceDeclareStyleableIntArray(String name) {
Field[] allFields = R.styleable.class.getFields();
for (Field field : allFields) {
if (name.equals(field.getName())) {
try {
return (int[]) field.get(R.styleable.class);
} catch (IllegalAccessException ignore) {}
}
}
return null;
}