Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region Project Attributes
- #ApplicationLabel: B4A Example
- #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 hour,minutes As Int
- Dim Phone As Phone
- Private Label1 As Label
- 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")
- Activity.LoadLayout("1.bal")
- End Sub
- Sub Activity_Resume
- End Sub
- Sub Activity_Pause (UserClosed As Boolean)
- End Sub
- Sub SetAlarm()
- Dim i As Intent
- i.Initialize("android.intent.action.SET_ALARM", "")
- i.PutExtra("android.intent.extra.alarm.HOUR", hour)
- i.PutExtra("android.intent.extra.alarm.MINUTES", minutes)
- i.PutExtra("android.intent.extra.alarm.SKIP_UI", False)
- StartActivity(i)
- End Sub
- Sub Button1_Click
- hour = DateTime.GetHour(DateTime.Now)
- minutes = DateTime.GetMinute(DateTime.Now)+1
- SetAlarm
- Label1.text = Phone.GetSettings("next_alarm_formatted")
- End Sub
- Sub Button2_Click
- Dim i As Intent
- i.Initialize("android.intent.action.SET_ALARM", "")
- i.PutExtra("android.intent.extra.alarm.SKIP_UI", True)
- StartActivity(i)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement