Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:18:58+00:00 2026-06-17T07:18:58+00:00

I currently have an Android application that has an intent-filter to receive images from

  • 0

I currently have an Android application that has an intent-filter to receive images from the Gallery. It is important that the images are received in the same order that the user selected them in. This seems to be the default behavior on most devices, however on some devices (so far I’ve seen this on Motorola’s running Android 4.x) the order seems undefined. Does anyone know a way to declare in the intent that the images should be received in order? Or a way once the images are recieved to determine the selected order?

Here is relevant code from the manifest

 <activity
       android:label="@string/app_name"
       android:name=".activities.ImportImagesActivity" > 
       <intent-filter>   
           <action android:name="android.intent.action.SEND" />
           <category android:name="android.intent.category.DEFAULT" /> 
           <data android:mimeType="image/*" />
       </intent-filter>
       <intent-filter>   
           <action android:name="android.intent.action.SEND_MULTIPLE" />
           <category android:name="android.intent.category.DEFAULT" /> 
           <data android:mimeType="image/*" />
       </intent-filter>
   </activity>

And from ImportImagesActivity

private List<Uri> parseIncomingData() {
    List<Uri> uriList = null;

    Intent intent = this.getIntent();
    if(intent != null) {
        String action = intent.getAction();
        //Single Image
        if (action.equalsIgnoreCase("android.intent.action.SEND")) {
            //removed for brevity
            }
        }
        //Multiple Images
        else if (action.equalsIgnoreCase("android.intent.action.SEND_MULTIPLE")) {
            uriList  = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
        }
    }

    //more code - at this point images have been recieved

    return uriList;
}

EDIT

To give a little context, let me explain the general flow of the app.
The user opens the Gallery and selects images. They choose to ‘Share’ them with my app. My application receives a list of Uri’s which are then displayed using an internal gallery backed by a custom Adapter class. The images display correctly based on the Uri list, the issue is the order of the List<Uri> is sometimes incorrect. It is important to my users that the images appear in the same order they select them in.

Clarification
When I use the term Gallery I am referring to the built in Android app Gallery.
When I use the term ‘Share’ I am referring to the the Share button within the Gallery app. This allows the user to select from a list of services such as Facebook, Email, and in this case my app.

For Example
imagine a Gallery with 3 images, displayed in an arbitrary order: A, B, and C. The user selects first C then A then B and chooses to share them with my app. On most phones my list will be correctly ordered {C, A, B}, on offending phones this order seems random.

I cannot use the creation timestamp because the creation time is generally irrelevant to the selection order. Adding custom meta data doesn’t help either because I don’t know the correct initial order.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:18:59+00:00Added an answer on June 17, 2026 at 7:18 am

    My observation is that Android gallery displays images in accordance to their recency.

    For the devices where you’re unable to determine the order, you can import the images from the gallery and check their creation time. Here’s a way to do that. Or you could use a metadata extractor app, many jars can be found.

    Now, you could just arrange the images in the order of recency and you should be done.

    [EDIT]

    I have a question. You said they may be selected in any order, so are they “uploading” it onto a server by “sharing”?

    If so, then one way is to check which image was uploaded or if you want the order of selection, you could do this. Edit the metadata of the images, there’s bound to be a useless tag, select one and edit it on touch. So, if I select image A it changes to 1 and then I select image B it becomes 2. But if I unselect image A now then image B should become 1. So, you could use nodes here. This is the first in first out (FIFO) method. Upon un-selection, A is thrown out of the list and B replaces it.

    Is this what you wanted?

    EDIT
    Sorry, I don’t think you can do this without creating your own gallery. Why don’t you just import the android gallery into a grid view in your app?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a notification in my Android application that has a PendingIntent so
I have an android application that currently has 9 tabs. Whenever a new tab
I am currently porting an application from iOS into Android and I have ran
I have a TextView in my android application that has a set width on
I have created an application for Android that has an activity that has a
I currently have an Android application that displays a schedule for a ferry boat.
I am currently developing an Android Application that has Google Maps integrated into it.
I’m working on an android application that currently has two Activities, A and B,
I am currently developing an android application using eclipse and I already have a
I currently have a Service in Android that is a sample VOIP client so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.