I am saving the images in an app-specific folder and when i am trying to fetch the list of all the images of that folder and saving them in an array, the order of images which i am getting is random. I want the list of images in the order they are created i.e the newest one should come on top. Is there any function to achieve that. I am using this code to get the list of all files and storing them in an array.
File[] listFile = downloadDir.listFiles();