I am developing in Android, I am reading a file from a folder and putting it in a list.
The list has two meanings: 1.Name 2.Time
It can display the list as the following code:
for(int i=0;i<fileList.size();i++){
Log.i("DownloadFileListTask", "file mName("+i+") = " + fileList.get(i).mName);
Log.i("DownloadFileListTask", "file mTime("+i+") = " + fileList.get(i).mTime);
}
And the log is as follows:
file mName(0) = /DCIM/100__DSC/MOV_0093.LG1
file mTime(0) = 2015-04-15 14:47:46
file mName(1) = /DCIM/100__DSC/PICT0094.JPG
file mTime(1) = 2015-04-15 14:47:52
file mName(2) = /DCIM/100__DSC/MOV_0095.LG1
file mTime(2) = 2015-04-15 14:48:04
file mName(3) = /DCIM/100__DSC/MOV_0096.LG1
file mTime(3) = 2015-04-15 14:48:12
file mName(4) = /DCIM/100__DSC/MOV_0097.LG1
file mTime(4) = 2015-04-15 14:48:20
file mName(5) = /DCIM/100__DSC/MOV_0098.LG1
file mTime(5) = 2015-04-15 14:50:26
From the magazine early time is at the first facility. But I want to change his order.
How to reorder the list on Android?
source
share