Search code examples
javaandroidandroid-gallery

How can we Sort image according to date


I am trying to make gallery application in which all media file are arranged in a GridView. It shows latest 1st and oldest last. But I wish to arrange its as according to Dates in GridView. Is this possible? I need you viable suggestions. Thanks in advance


Solution

  • What I get from your question is all you have to do is store month as some string value while inserting a particular image then

    When you are fetching your data check for the current month then previous and such that. In this case you will face problem in dates like in a month say July which is latest and which is oldest soo for that, I will say

    Dont save images in sqlite but in sdcard and create file path of every file in that folder and check the date of creation from that file object and display.

    Feel free to ask :)