Reputation: 103
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??
Upvotes: 7
Views: 1550
Reputation: 8231
Use Collections.sort()
-
Collections.sort(vector, new myComparator());
Also think about using ArrayList<>
instead of Vector
- Vector
is deprecated
Upvotes: 13