...
Sub Service_Start (StartingIntent As Intent)
' rv.UpdateWidget
' If rv.HandleWidgetEvents(StartingIntent) Then Return
If StartingIntent.Action = "android.appwidget.action.APPWIDGET_DELETED" Then Return
' Handle the widget events
If rv.HandleWidgetEvents(StartingIntent) = False Then
' If the action is not handled by HandleWidgetEvents() then we
' probably were called by StartService() or StartServiceAt().
' So just update the widget.
rv_RequestUpdate
End If
' We have to be sure that we do not start the service
' again if all widgets are removed from homescreen
If StartingIntent.Action <> "android.appwidget.action.APPWIDGET_DISABLED" Then
' 1min = 60000 ms
Dim osv As Long = DateTime.Now + (interval * 60000)
StartServiceAt("", osv, False)
End If
end sub
...
Sub rv_Disabled
CancelScheduledService("")
StopService("")
End Sub
Sub DLXml
Dim job1 As HttpJob
job1.Initialize("test", Me)
job1.Download(link)
End Sub
Sub rv_RequestUpdate
DLXml
...
end sub
Sub JobDone(job As HttpJob)
If job.Success = True Then
Select job.JobName
Case "test"
rss.parse...
UpdateWidgetInfo
Else
Log ("Error: " & job.ErrorMessage)
End If
job.Release
End Sub
Sub UpdateWidgetInfo
...
rv.UpdateWidget
Ens Sub