D dcoun Member Licensed User Longtime User Mar 21, 2018 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Mar 21, 2018 #2 dcoun said: 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: Click to expand... You can always use the constant value which is "android.intent.action.SEND_MULTIPLE". Please log the intent and its extras. Upvote 0
dcoun said: 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: Click to expand... You can always use the constant value which is "android.intent.action.SEND_MULTIPLE". Please log the intent and its extras.
D dcoun Member Licensed User Longtime User Mar 21, 2018 #3 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: Mar 21, 2018 Upvote 0
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