Android Question How I can trap errors using LoadBitmap?

Reproretro

Member
Licensed User
Longtime User
I have a number of small images in dirassets as a sort of cache. I read the name of the required image from HTML then attempt to load it from dirassets, e.g.:
Pic1.bitmap=LoadBitmap(File.dirassets, PicName)

The idea being that I read it form the website only if I have to.
How do I tell if the image already exists?
 

Roycefer

Well-Known Member
Licensed User
Longtime User
B4X:
If File.Exists(File.DirAssets, "myimage.png") Then
        Pic1.Bitmap = LoadBitmap(File.DirAssets, "myimage.png")
Else
        Pic1.Bitmap = DownloadImage
End If
 
Upvote 0
Top