ImageView crashes

gadgetmonster

Active Member
Licensed User
Longtime User
Hi All,

I use a contentchooser to allow the user to choose an image. Once the user selects an image I put the selected image into an ImageView as follows:

B4X:
Sub imageChooser_Result (Success As Boolean, Dir As String, FileName As String) 

    If Success Then 
   
   imagePhoto.Bitmap = LoadBitmap(Dir, FileName)   
   imagePhoto.Gravity = Gravity.FILL
      
    Else 
           ToastMessageShow("No image selected", True) 
    End If 
End Sub

This works great the first time, but if you then use the contentchooser to select a different image the app just crashes (blank screen) no errors.

My imageView was added through the designer so no initialize needed and the imageView is declared in Globals.

Any ideas?
 
Last edited:
Top