Thanks for the help! Setting a value to 1 works fine.
I have a widget wid = ConfigureHomeWidget("widgetlayout", "wid", 0, "somename"). But for some reason the "Sub wid_Disabled" is not called. In this sub I set the value back to 0.
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Dim wid As RemoteViews
End Sub
Sub Service_Create
wid = ConfigureHomeWidget("widgetlayout", "wid", 0, "somename")
includes.set_setting("widgeton", "1") 'sets a value in file to 1
End Sub
Sub Service_Start (StartingIntent As Intent)
If wid.HandleWidgetEvents(StartingIntent) Then Return
update
End Sub
Sub Service_Destroy
End Sub
Sub wid_RequestUpdate
update
End Sub
Sub wid_Disabled
includes.set_setting("widgeton", "0") 'sets a value in file to 0
StopService("")
End Sub
The wid_Disabled is never called. What am I doing wrong. When loging the events I only see Service (widget) start but never destroyed. Even if I close the widget.
Another very strange thing ist that when I run my app I get this log:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Service (widget) Create **
** Service (widget) Start **
But I dont touch it and the service widget is not started in my code. Why does it pause and then reasume an start the service??? When I deinstall the widget I also get the Service start log.