i Liste der Tags in forloop für Iterierte vorbei, aber seine angehobene ConcurrentModificationExceptionConcurrentModificationException für jeden in android
public void clearTag() {
List<Tag> tags = binding.search.tagView.getTags();
Log.d(TAG, "clearTags: " + tags);
for (Tag tag : tags) {
Log.d(TAG, "clearTag: " + tag + " " + tag.getLayoutColor());
if (tag.getLayoutColor() == R.color.red) {
tags.remove(tag);
} else if (tag.getLayoutColor() == R.color.blue) {
tags.remove(tag);
} else if (tag.getLayoutColor() == R.color.green) {
tags.remove(tag);
}
}
updateTagVisibility();
//resetFilter();
}
Sie Dinge aus der Sammlung zu entfernen Sie iterieren. Das ist nicht erlaubt – 0xDEADC0DE
danke für die Antwort. dann, wie man das löst. – sam