Closed FAUSheppy closed 2 years ago
And long story short: This is why one shouldn't create sub-variables for data-set entries, because if you then do this:
It won't work :)
It's also unessesary to use a List for sorting at all, you can and should use a sorted Set like TreeSet:
TreeSet<String> set = new TreeSet<String>();
set.add("B");
set.add("A");
set.add("C");
for (String s : set) {
System.out.println(s);
}
Output:
A
B
C
Adding a new weight entry fails if you:
This is because the recyler view reuses the existing ViewHolder and calls bindView instead of createView, which means the entryKey sets won't be updated with the new entry, meaning the List is empty and this happens: