Sub Globals
Dim Buttons() as Button
end sub
Sub Activity_Create(FirstTime As Boolean)
For i=0 to X-1 'think about needed X qty
dim a as Button
a.Initialize("Buttons")
Activity.AddView(a, i1, i2, w, h) 'think about coordinates and dimentions
Buttons(i) = a 'try to use these names of buttons
next
Sub Buttons_Click
Dim a as Button
a = Sender 'but here, seems, anyway it needs to check all the buttons to understand which is pressed
end sub