Hello
I would like to obtain the path of several images selected from the gallery.
I have tried the example of this thread with 4 random images.
I can see in mClipData.mItems the paths.
I think that they might be obtained with GetPathFromContentResult but I don't know how do it.
Thanks.
I would like to obtain the path of several images selected from the gallery.
I have tried the example of this thread with 4 random images.
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
If Args(0) = -1 Then 'resultCode = RESULT_OK
Dim i As Intent = Args(1)
Dim jo As JavaObject = i
'Dim Uri1 As Uri
End If
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 think that they might be obtained with GetPathFromContentResult but I don't know how do it.
Thanks.