开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜