I have 201 text files in my raw folder naming level0.txt,level1.txt,level2.txt........
I want to read them but dont wanna get in trouble of writing 201 lines of code
so far i have tried this
private void readLevelName() {
for (int i = 0 ; i <= 200 ; i++){
String s = RRaw.substring(0,11)+i;
map[i]= Integer.parseInt(s);
// Log.e(""+i , s);
}
RRaw is my string containing "R.raw.level", map[] is an int array
Error is
Caused by: java.lang.NumberFormatException: Invalid int: "R.raw.level0"
guys any help will be appreciated