Dynamically build a resource Identifier
I am tring to get a开发者_高级运维 resource dynamically using
String[] stringarray = res.getStringArray(R.array.XXXX);
Where XXXX is a variable. Any Suggestions? Thanks
int resID = getResources().getIdentifier("the_variable",
"id", "your.package.name");
String[] stringarray = res.getStringArray(resID);
精彩评论