I made a customlistview in b4a but I can not fix the click event.
I want when button clicks image to pause and other buttons image to play when click image button is changed but other button image not change.
my code load
Sub load
For i = 0 To cur.RowCount-1
cur.Position=i
Dim p As Panel
play.Text = Chr(0xE037)
p.Initialize("p")
sco.Panel.AddView(p,1%x,top,98%x,500dip)
p.LoadLayout("layload")
play.Tag = cur.GetInt("id")
play.Typeface = awf
text.Text = cur.GetString("text")
top = top + 60dip + 2%x
Next
sco.Panel.Height = top + 10dip
End Sub
and code play
Sub play_Click
tim.Enabled = True
Dim lml As Label
lml.Initialize("lml")
lml = Sender
Dim curbv As Cursor
curbv = sql.ExecQuery("SELECT * FROM tab1 ")
curbv.Position = lml.Tag - 1
sec = curbv.Position
meda.Load(File.DirAssets,curbv.GetString("mp"))
kl(lml)
End Sub
and my code for change icon
Sub kl( ln As Label)
If ln.Text = Chr(0xE037) Then
ln.Text = Chr(0xE047)
meda.Play
load
Else If ln.Text = Chr(0xE047) Then
ln.Text = Chr(0xE037)
meda.Stop
End If
Sleep(100)
play.Text = Chr(0xE037)
End Sub