Android Question Problem:number instead of filename

angelone

Member
Licensed User
Longtime User
Hi, i'm using the code below to get the filename from filechooser and put it in a i tag of imageview.
But i obtain a number instead of filename.


Sub chooser_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
selectpecs.Bitmap=LoadBitmap(Dir,FileName)
selectpecs.Tag = FileName.SubString(FileName.LastIndexOf("/") + 1)
End If
End Sub
 

derez

Expert
Licensed User
Longtime User
The filename string does not include "/" so you have to write
B4X:
selectpecs.Tag = FileName
The use of last index will be true if you try to get the name from a string which is the full filename, including the path.
 
Upvote 0

angelone

Member
Licensed User
Longtime User
thank's Derez, but i continue to get a number :mad:
Cattura.PNG
 
Upvote 0
Top