Hello,
I have 12 imageviews holding bitmaps, representing a set of cards. I use the same click event for all imageviews. To determine wich card was clicked, I try to read out the name of the attached bitmap. I think I need a function like "ToString" but can't seem to find how to do this in B4A.
In the code below the line "clickedBitmap = b.bitmap" generates an error. Intellisense tells me: "Object converted to string. This is probably a programming mistake. (warning #7)". The line above that, writing the contents of b.bitmap to the log works just fine.
I think I need to find a way to convert the content of b.bitmap to a string, so I can determine it's value. Any help on this is greatly appreciated.
Thanks,
Mark
I have 12 imageviews holding bitmaps, representing a set of cards. I use the same click event for all imageviews. To determine wich card was clicked, I try to read out the name of the attached bitmap. I think I need a function like "ToString" but can't seem to find how to do this in B4A.
In the code below the line "clickedBitmap = b.bitmap" generates an error. Intellisense tells me: "Object converted to string. This is probably a programming mistake. (warning #7)". The line above that, writing the contents of b.bitmap to the log works just fine.
B4X:
Sub Card_Click
' Using Sender we find the button that raised this event
Dim b As ImageView
Dim clickedBitmap As String
b = Sender
imgHuge.Bitmap = b.bitmap
Log ("b.bitmap = '" & b.bitmap & "'")
' When SET-card is clicked: b.bitmap = 'android.graphics.Bitmap@c5b66a9'
clickedBitmap = b.bitmap
Log ("clickedBitmap = '" & clickedBitmap & "'")
If clickedBitmap = "android.graphics.Bitmap@c5b66a9" Then
Msgbox ("SETTINGS", "")
' TODO: Open settings-activity
Else
For x = 0 To 2
For y = 0 To 4
Cards(x,y).SetVisibleAnimated(1000,False)
Next
Next
imgHuge.SetVisibleAnimated(1000,True)
End If
End Sub
I think I need to find a way to convert the content of b.bitmap to a string, so I can determine it's value. Any help on this is greatly appreciated.
Thanks,
Mark