I've got an ArrayList called PhotoArrayList. It contains strings like "picture1.jpg, picture2.png, picture3.gif etc." There is like 50 or 60 strings in this ArrayList. I need to add path of their folder in the beginning like "mnt/sdcard0/Pictures/picture1.jpg etc." So, I'm using following code
Integer PhotoFileAmount = PhotoArray.length; //PhotoArray and PhotoArrayList are same
for(int i=0; i < PhotoFileAmount; i++){
String PhotoFileAndPath = (PhotoFolder + '/' + PhotoArrayList.get(i));
PhotoArrayList.remove(PhotoArrayList.get(i));
PhotoArrayList.add(PhotoFileAndPath);
}
But I'm getting a strange result. The beginning of PhotoArrayList is unchanged while it's middle part is okay and last part gets the path twitce. Like "picture1.jpg, mnt/sdcard0/Pictures/picture2.png, mnt/sdcard0/Pictures/mnt/sdcard0/Pictures/picture3.gif