Seems like there is a new API in Android 4.3 which allows you to select multiple images from the gallery. If it is relevant (as it will not work on older versions) then I can help you implement it.
Hi @Erel , Is this info documented anywhere? I'm interested in selecting multiple images from the gallery.Seems like there is a new API in Android 4.3 which allows you to select multiple images from the gallery. If it is relevant (as it will not work on older versions) then I can help you implement it.
Sub Activity_Click
Dim i As Intent
i.Initialize("android.intent.action.GET_CONTENT", "")
i.PutExtra("android.intent.extra.ALLOW_MULTIPLE", True)
i.SetType("image/*")
StartActivityForResult(i)
End Sub
Sub ion_Event (MethodName As String, Args() As Object) As Object
'Args(0) = resultCode
'Args(1) = intent
Return Null
End Sub
Sub StartActivityForResult(i As Intent)
Dim jo As JavaObject = GetBA
ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null)
jo.RunMethod("startActivityForResult", Array As Object(ion, i))
End Sub
Sub GetBA As Object
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)
Return jo.GetField("processBA")
End Sub
Hi Erel, this code does not work with my LG G3, i'm running L Version on it, the app does not crash at all, i can see the image gallery come up but i can not choose multiple images, are you aware of any other way to select multiple images and return the path for all the images selected.I've tried the solution described here: http://stackoverflow.com/questions/19585815/select-multiple-images-from-android-gallery
with this code. However it doesn't work on Nexus 5.
B4X:Sub Activity_Click Dim i As Intent i.Initialize("android.intent.action.GET_CONTENT", "") i.PutExtra("android.intent.extra.ALLOW_MULTIPLE", True) i.SetType("image/*") StartActivityForResult(i) End Sub Sub ion_Event (MethodName As String, Args() As Object) As Object 'Args(0) = resultCode 'Args(1) = intent Return Null End Sub Sub StartActivityForResult(i As Intent) Dim jo As JavaObject = GetBA ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null) jo.RunMethod("startActivityForResult", Array As Object(ion, i)) End Sub Sub GetBA As Object Dim jo As JavaObject Dim cls As String = Me cls = cls.SubString("class ".Length) jo.InitializeStatic(cls) Return jo.GetField("processBA") End Sub
I have, i added some stuff to one of Informatix's classes, i will share the class with you soon, as son as i find it.has anybody found a solution for selecting multiple images from the gallery?
That would be great, thank you!I have, i added some stuff to one of Informatix's classes, i will share the class with you soon, as son as i find it.