Android Question How I can trap errors using LoadBitmap?

Discussion in 'Android Questions' started by Reproretro, Jul 7, 2015.

  1. Reproretro

    Reproretro Member Licensed 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?
     
  2. Roycefer

    Roycefer Well-Known Member Licensed User

    Code:
    If File.Exists(File.DirAssets, "myimage.png"Then
            Pic1.Bitmap = 
    LoadBitmap(File.DirAssets, "myimage.png")
    Else
            Pic1.Bitmap = DownloadImage
    End If
     
    Reproretro likes this.
  3. Reproretro

    Reproretro Member Licensed User

    Thank you.
     
Loading...