i have a arraylist called arrstatus which has a set of Numeric values stored dynamically. I have to Replace those Numeric Values with Unique String values. I tried various methods it doesnt seem to be working i tries Set method, didnt work,
// int[] flags = new int[arrstatus_old.size()];
int [] c = new int [arrtaskid.size()];
Toast.makeText(MyTask.this, "C:"+c, Toast.LENGTH_LONG).show();
for(int j=1;j<= c.length;j++)
{
if(arrstatus.get(j).equals("1"))
{
arrstatus_old.set(j, "Saved");
}
else if(arrstatus.get(j).equals("2"))
{
arrstatus_old.set(j, "Assigned");
}
else if(arrstatus.get(j).equals("3"))
{
arrstatus_old.set(j, "Accepted");
}
else if(arrstatus.get(j).equals("4"))
{
arrstatus_old.set(j, "Rejected");
}
}
I am not getting the size of the arrastutus, it says 0 and hence no values are getting replaced, any better idea to replace the value.?
j<= c.lengthThis might causeArrayIndexOutOfBoundsException.j <= c.length - 1ifs on the last index..0