Android Question Receiving multiple shared images from other apps

dcoun

Member
Licensed User
Following the tutorial here: https://www.b4x.com/android/forum/threads/receiving-shared-images-from-other-apps.81041/#post-574557

I was wondering if the code in the above tutorial can be modified to accept multiple images...
We need a new manifest addition:
B4X:
AddActivityText(Main,
    <intent-filter>
        <action android:name="android.intent.action.SEND_MULTIPLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>)
and the first problem I noticed is in the "IsRelevantIntent" sub where the "in.ACTION_SEND_MULTIPLE" is not recognized by the IDE even though it exists here: https://developer.android.com/reference/android/content/Intent.html

After that I am wondering how the
B4X:
in.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM"))
will be transformed to do the same as android developer guide suggests:
B4X:
ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
thank you in advance
 

dcoun

Member
Licensed User
You have right, the following works:
B4X:
If in.Action = "android.intent.action.SEND_MULTIPLE"  Then .....
And, I think the following does also the job:
B4X:
Dim List1 As List = in.RunMethod("getParcelableArrayListExtra", Array As Object("android.intent.extra.STREAM"))
type can be found by
B4X:
Dim Type As String=(in.RunMethod("getType",Array()))
Thanks a lot
 
Last edited:
Top