0

I intend to pass multiple file-URIs/Paths to my Activity using intent. I have the necessary code in place (i.e. SEND_MULTIPLE in Manifest and getIntent() in Activity) and I am able to get the file-list from the intent in my Activity. However, this file-list is sorted in alphabetical order and not in the same order as I selected my files from Gallery.

Is there a way to get the file-list in same order as I select the files in Gallery?

Gagan
  • 1,497
  • 1
  • 12
  • 27

1 Answers1

0

I am afraid to tell you that it seems like, there are no way to ensure the sorting order of the data send using the Intent. That's why you have to do it by yourself.

I do recommend for you to create a Parcelable object contain two things (int order, String url). Then send the list of the Parcelable objects using the intent. Then implement a simple comparator to sort those object after retrieving them using the order attribute

Community
  • 1
  • 1
Sami Eltamawy
  • 9,874
  • 8
  • 48
  • 66