private void updateCardInList(Card card) { Note note = card.note(); for (Card c : note.cards()) { int aPos = getPosition(mAllCards, c.getId()); int pos = getPosition(mCards, c.getId()); String sfld = note.getSFld(); mAllCards.get(aPos).put("sfld", sfld); mCards.get(pos).put("sfld", sfld); if (mWholeCollection) { String deckName; try { deckName = mCol.getDecks().get(card.getDid()).getString("name"); } catch (JSONException e) { throw new RuntimeException(e); } mAllCards.get(aPos).put("deck", deckName); mCards.get(pos).put("deck", deckName); } String flags = Integer.toString((c.getQueue() == -1 ? 1 : 0) + (note.hasTag("marked") ? 2 : 0)); mAllCards.get(aPos).put("flags", flags); mCards.get(pos).put("flags", flags); } updateList(); }