简体   繁体   English

Android中的倒数计时器重排

[英]Countdown timer rearrangement in android

i am getting multiple items having countdown timers from back end and i am storing those in array list. 我从后端获取多个具有倒数计时器的项目,并将它们存储在数组列表中。 I want to rearrange them according to decreasing order. 我想按照降序重新排列它们。 Please help me, i am stuck. 请帮助我,我被困住了。

So, you want to sort into an array... see: http://www.homeandlearn.co.uk/java/sorting_arrays.html and/or: Java: Sort an array and/or: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#newwindow=1&q=sort+in+array+java 因此,您想排序成一个数组...请参阅: http : //www.homeandlearn.co.uk/java/sorting_arrays.html和/或: Java:对数组进行排序和/或: https:// www。 google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#newwindow=1&q=sort+in+array+java

The instruction which can help you to sort an array is: 可以帮助您对数组进行排序的说明是:

Arrays.sort(your_array,Collections.reverseOrder());

Good luck :) 祝好运 :)

for a list 清单

Collections.sort(list ,Collections.reverseOrder());

for an array 用于数组

Arrays.sort(array, Collections.reverseOrder());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM