在我的android应用程序中,当尝试按包含数字抛出异常的名称获取资产文件夹中的资源时
int i=9;
int resourceId = this.getResources().getIdentifier("level_1_img_" + i, "id", this.getPackageName());
Button button = (Button) findViewById(resourceId);
Drawable drawable = Drawable.createFromStream(getAssets().open("level_1_img_" + i), null);
button.setBackground(drawable);在、阿拉伯语、或上运行时,本地i更改为本地数字并抛出异常。images/level1/۹.png
我要防止这种变化,怎么做呢?
发布于 2017-06-22 13:48:16
根据我们的讨论
换衣服就行了。
images.add(String.Formate("images/level1.....至
images.add("images/level1/"+i+".png")https://stackoverflow.com/questions/44699696
复制相似问题