#Region Project Attributes
#ApplicationLabel: Quiz10
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btnlist(101) As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
For i = 0 To 100
btnlist(i).Initialize
Next
For i = 0 To 1999
Dim btn As Button
btn.Initialize("button")
Dim posx As Int = Rnd(0,100%x-50dip)
Dim posy As Int = Rnd(0,100%y-50dip)
Dim zufall As Int = Rnd(1, 101)
Dim col As Int
col = Colors.ARGB(Rnd(100, 150),Rnd(20, 800),Rnd(80, 160),Rnd(161, 255))
btn.Color = col
btn.Text = zufall
btn.Tag = zufall
Activity.AddView(btn,posx,posy,50dip,50dip)
btnlist(zufall).Add(btn)
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button_Click
Dim b As Button
b = Sender
Dim buttonlist As List
buttonlist = btnlist(b.Tag)
Log("Button "&b.Tag&" clicked. "&buttonlist.Size&" Buttons")
ToastMessageShow("Button "&b.Tag&" clicked. "&buttonlist.Size&" Buttons", True)
For i = 0 To buttonlist.Size -1
Dim t As Button
t = buttonlist.Get(i)
t.BringToFront
Next
End Sub