I am trying to sort vector of items using comparator in android. I tried:
vector.sort(new myComparator());
but it shows error:
Call requires API level 24 (current min is 15): java.util.Vector#sort
Any solution to it??
Use Collections.sort()
-
Collections.sort(vector, new myComparator());
Also think about using ArrayList<>
instead of Vector
- Vector
is deprecated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With