Android Question Open the image gallery

antofer

Member
Licensed User
hello
using translator ......

I would like to know how I can open the image gallery by clicking on a imageView for the user to select one of them and the application for the path of the selected image

thank you very much
 

antofer

Member
Licensed User
Thank you very much .....

opens the gallery but how do I get the address of the selected file?

feel the awkwardness ....... learning
 

KZero

Active Member
Licensed User
**Use Phone library

B4X:
 Dim Chooser As ContentChooser
   Chooser.Initialize("chooser")
   Chooser.Show("image/*", "Select an image")

B4X:
Sub chooser_Result (Success As Boolean, Dir As String, FileName As String)
    If Success Then
        ImageView1.Bitmap=LoadBitmap(Dir,FileName)
    Else
        ToastMessageShow("No image selected", True)
    End If
End Sub
add this line to "Project" Menu > Manifest Editor
B4X:
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
 
Top