Issue
In my android app , when try get resource in asset folder by name that contain number throw exception
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);
when running on Arabic or Persian local i
changed to local number and throw exception. images/level1/۹.png
I want to prevent this change, how to do this?
Solution
As per we discuss
Just change .
images.add(String.Formate("images/level1.....
To
images.add("images/level1/"+i+".png")
Answered By - Vishal Patel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.