开发者

Dynamically build a resource Identifier

开发者 https://www.devze.com 2023-02-17 11:20 出处:网络
I am tring to get a开发者_高级运维 resource dynamically using String[] stringarray = res.getStringArray(R.array.XXXX);

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

精彩评论

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