Android Question BitmapsAsync Grid specific image click event: I need an example

MarcoRome

Expert
Licensed User
Longtime User
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Your question has nothing to do with BitmapsAsync. BitmapsAsync is just responsible for loading bitmaps.
2. Don't use BitmapsAsync. Use SimpleMediaManager instead.

A modified version of SMM_Example2 is attached. It handles the click event (B4A only - should be trivial to make same changes in layout in B4J and B4i).
 

Attachments

  • SMM_Example2.zip
    186.4 KB · Views: 191
Upvote 0
Considering that the bread in B4J, unlike the B4A panel does not have the click event, I used this code that works. Is there a better way? If no one answers then it means this is the only way.

Added pane click event in B4J:
#if B4A
Private Sub pnlImage_Click
    Dim ImageIndex As Int = Sender.As(B4XView).Tag
    Log($"Clicked on image: ${ImageIndex}"$)
End Sub
#else

Private Sub pnlImage_MouseClicked (EventData As MouseEvent)
    Dim ImageIndex As Int = Sender.As(B4XView).Tag
    Log($"Clicked on image: ${ImageIndex}"$)
End Sub
#end if
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…