android - How to sort the array list maximum value on first position -


this question has answer here:

i want sort array list having maximum value in first position. doing shown below:

for (int = 0; < str_position.size(); i++) {                               int position_id = str_position_id_one_time;                             position_id--;                             log.e("position_id---=------>",""+position_id);                             str_position_id_one_time = position_id;                              array_bitmap_grid_adpater.remove(integer.parseint(str_position.get(i)));                             adapter_gridview.notifydatasetchanged(); 

sort array list maximum value on first position ex : [0, 1, 5, 3] need [5, 3, 1, 0]

here's 1 way list:

collections.sort(list); collections.reverse(list); 

or 1 line

collections.sort(unsortedarraylist, collections.reverseorder()); 

first sort reverse ;)