Android Question Image File Name

Declan

Well-Known Member
Licensed User
Longtime User
I am using the following code to display an image from the Gallery:
B4X:
Sub imgChooser_Result (Success As Boolean, Dir As String, FileName As String)
    Dim MyWidth As Int
    Dim MyHeight As Int
    MyWidth = imgPhoto.Width
    MyHeight = imgPhoto.height
    ImageName = FileName
    If Success Then
       imgPhoto.Bitmap = LoadBitmapSample(Dir, FileName, MyWidth, MyHeight)
       imgPhoto.Gravity = Gravity.FILL
       pnlViewer.Visible = True
       btnMainReturn.Visible = False
       ToastMessageShow("Image selected" & FileName, True)
    Else
        ToastMessageShow("No image selected", True)
    End If
    lblDetailsImageText.text = ImageName
End Sub
All is OK and the image displays no problem.
However, the image file name is displayed as:
content://com.android.providers.media.documents/document/image%3A4307
and not its actual file name.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…