diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/ListFragment.java b/omniNotes/src/main/java/it/feio/android/omninotes/ListFragment.java index 09a3b3139..7572e00fb 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/ListFragment.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/ListFragment.java @@ -1821,8 +1821,8 @@ private void filterByTags() { .setPositiveButton(R.string.ok, (dialog, which) -> { var items = ((AlertDialog) dialog).getListView().getCheckedItemPositions(); var selectedTags = new ArrayList(); - for(int i = 0; i < items.size(); i++) { - if (items.valueAt(i)) { + for(int i = 0; i < tags.size(); i++) { + if (items.get(i)) { selectedTags.add(tags.get(i).getText()); } }