'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim rv As RemoteViews
End Sub
Sub Service_Create
' Configure the widget.
'----------------------
rv = ConfigureHomeWidget("widget", "rv", 0, "Leiman", True)
End Sub
Sub Service_Start (StartingIntent As Intent)
If IsPaused(ChimeService) Then
rv.SetText("ButtonMasterControl", "Disabled")
Else
rv.SetText("ButtonMasterControl", "Enabled")
End If
If rv.HandleWidgetEvents(StartingIntent) Then
Return
End If
End Sub
Sub Service_Destroy
End Sub
Sub rv_RequestUpdate
rv.UpdateWidget
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub ButtonMasterControl_Click
If IsPaused(ChimeService) Then
StartServiceAt(ChimeService, DateTime.Now, True)
rv.SetText("ButtonMasterControl", "Enabled")
Else
StopService(ChimeService)
rv.SetText("ButtonMasterControl", "Disabled")
End If
End Sub