Android Question Detect Simple Media Manager click event?


Well-Known Member
Licensed User
Longtime User
In Item designer there are 4 panels with 1 label in each panels. The label contains the numbers in text field. How can i trap which label is clicked?
I had a hard time figuring it out using tag and sender.

Sub CustomListView1_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
    For Each i As Int In PCLV.VisibleRangeChanged(FirstIndex, LastIndex)
        Dim item As CLVItem = CustomListView1.GetRawListItem(i)
        Dim pnl As B4XView = xui.CreatePanel("PanelNumber")
        item.Panel.AddView(pnl, 0, 0, item.Panel.Width, item.Panel.Height)
        Dim data As MyImageData = item.Value
        'Create the item layout
        For x = 0 To 3
            pnl.GetView(x).GetView(1).Text = data.IndexOfFirstImage + x
            MediaManager.SetMedia(pnl.GetView(x).GetView(0), $"${data.IndexOfFirstImage + x}/200/300.jpg"$)
    'The purpose of this call is to find panels that are no longer in the views tree and cancel any ongoing request that is no longer relevant.
    'It also happens automatically from time to time but in this case, as many requests are sent frequently, it is better to force it to trim the cache.
    'Note that you need to add HU2_PUBLIC to the build configuration.
End Sub


Well-Known Member
Licensed User
Longtime User
Here is an attached example. Click on the pictures. The Sub PanelItems_Click is incomplete and can't figure this out. Thanks in advance.


  • SMM
    12.1 KB · Views: 21
Upvote 0