Sub Process_Globals
Type Pos(x As Int,y As Int)
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Test")
Buttons
B4X:
Sub Buttons
For x = 0 To 2
For y = 0 To 4
Dim ButtonX As Button
Dim PosX As Pos
PosX.x = x
PosX.y = y
ButtonX.Initialize("Button")
ButtonX.Tag = PosX
Activity.AddView(ButtonX,x*33%x,y*20%y,33%x,20%y)
Next
Next
End Sub
Sub Button_Click
Dim Button1 As Button
Button1 = Sender
Dim Pos1 As Pos
Pos1 = Button1.Tag
Log(Pos1.x & " " & Pos1.y)
End Sub