Sort SparseArray in Android
android
Solution
It is not clear if you requested a key or value sorted order ...
so just a note:
A binary search only works on sorted data and SparseArray uses a binary search for its sorted (!) keys array according to the source. So the keys ARE already sorted and won't accept a different order like the order from the values.
Problem
How can I sort android.util.SparseArray? E.g. I have SparseArray with: 1 - 2.33 5 - 1.5 Result: 5 - 1.5 1 - 2.33 Thanks!!! -- EDITED I've used the Map. Thanks for help.