'Activity module
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 Button1 As Button
Dim EditText1 As EditText
Dim Label1 As Label
Dim Spinner1 As Spinner
Dim Label2 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("TIPS")
spinner1.Add("Normal Tip")
spinner1.Add("Good Tip")
spinner1.Add("Lousy Tip")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Dim amount As Double
amount = edittext1.Text
If spinner1.SelectedIndex = 0 Then
label1.Text = "$" & NumberFormat(amount * .15, 0, 2) & " tip"
End If
If spinner1.SelectedIndex = 1 Then
label1.Text = "$" & NumberFormat(amount * .20, 0, 2) & " tip"
End If
If spinner1.SelectedIndex = 2 Then
label1.Text = "$" & NumberFormat(amount * .10, 0, 2) & " tip"
End If
End Sub