Let's pretend I have
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
I want to remove only one item of the listview but when I do this it removes all the items from the ArrayList. Do you know why?
int j=-1;
for (int i=0; i < mIds.size(); i++){
if (mIds.get(i) == modifier.getId()){
j=i;
break;
}
}
if (j != -1){
mIds.remove(j);
}
EDIT: Sorry guys my problem was another; but I thought it is related on of removing list items. Thanks to everyone for the help