Android Question How to Share Multiple Images?

shashkiranr

Active Member
Licensed User
Longtime User
Hi,

I searched through the forum and could find ways to share single images but i want to share multiple images. can someone guide me as to how to go about it?

Regards,
SK
 

barx

Well-Known Member
Licensed User
Longtime User
Do you mean sharing from the gallery. If so I'm assuming you are using an intent filter 'android.intent.action.SEND'?
For multiple images it is similar setup but using 'android.intent.action.SEND_MULTIPLE'.
 
Upvote 0

shashkiranr

Active Member
Licensed User
Longtime User
Thank you Barx, Could you kindly give an example of the code. IF i include the multiple images as an array it is force closing.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
i may be misunderstanding your original request.explain a little more your request. and how you are doing it for single image.
 
Upvote 0

shashkiranr

Active Member
Licensed User
Longtime User
I am using the below code from this post http://www.b4x.com/android/forum/threads/share-bitmap-question-how-to.11638/
B4X:
Dim r As Reflector
  Dim f As Object
  f = r.CreateObject2("java.io.File", Array As Object("file:///sdcard/1.jpg"), Array As String("java.lang.String"))
  Dim share As Intent
  share.Initialize(share.ACTION_SEND,"")
  share.SetType("image/jpeg")
  share.PutExtra("android.intent.extra.STREAM", r.RunStaticMethod("android.net.Uri", "fromFile", _
      Array As Object(f), Array As String("java.io.File")))
  share.WrapAsIntentChooser("Share Photo:)")
  StartActivity(share)
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I understood wrong, sorry. was early morning for me. I was think of getting multiple images shared from another app.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I have no idea sorry.
 
Upvote 0
Top