[Solved] Android how to sum the same object an ArrayList
[ad_1] I solved my question, is not simple question IF first added boolean equals in my class public boolean equals(Object o) { ItemAdubacao adubacao = (ItemAdubacao) o; if (this.getTanque_id() == adubacao.getTanque_id() && (this.getProduto().equals(adubacao.getProduto()))) { return true; } return false; } then I created an ArrayList to separate the duplicate objects and adding the sum of … Read more