I have a CLV with 4 buttons on each row.
All buttons cal the same sub
What is the appropriate way to define the sub so it works for B4A & B4J
At the moment I have this but feel there is a better way.
B4X:
#if b4a
Private Sub iv1_Click
#else B4J
Private Sub iv1_MouseClicked (EventData As MouseEvent)
#end if
Dim tempiv As B4XView = Sender
Main.currentMakeID = tempiv.Tag
B4XPages.ShowPage("model page")
End Sub
I think you're using the right way, from this Erel's example, where you can learn a lot of things, this is the way he does: (this way is compatible with B4i too)
B4X:
#if B4J
Private Sub iv1_MouseClicked (EventData As MouseEvent)
#else
Private Sub iv1_Click
#end if
Dim tempiv As B4XView = Sender
Main.currentMakeID = tempiv.Tag
B4XPages.ShowPage("model page")
End Sub
Are your iv1 objects Buttons or ImageViews?
I tested Button_Click in B4J before sending my previous post, and it works.
Only Buttons have a Click event in B4J.
Are you iv1 objects Buttons or ImageViews?
I tested Button_Click in B4J before sending my previous post, and it works.
Only Buttons have a Click event in B4J.