I have two ArrayLists from a Parse Query that I am comparing with an enhanced for loop. I want to check to see if there is a matching ObjectId in the 2 Lists, if so, I want to remove that Object from "allDropList". All other components are working properly, I believe the problem to be with my enhanced for loop syntax. Here is my code, thanks! Note: I have experimented with "if" and "while", with no success.
public ArrayList<DropItem> filterDrops(ArrayList <DropItem> hasRelationList , ArrayList <DropItem> allDropsList){
for(DropItem dropItemAll : allDropsList) {
for(DropItem dropItemRelation : hasRelationList) {
/*if*/ while(dropItemAll.getObjectId().equals(dropItemRelation.getObjectId())) {
allDropsList.remove(dropItemAll);
}
}
}
return allDropsList;
}