Hello,
I created my first widget and i would like to get a value from KVS. Where is the best to initialize KVS? At create sub or start sub?
I created my first widget and i would like to get a value from KVS. Where is the best to initialize KVS? At create sub or start sub?
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Dim rv As RemoteViews
End Sub
Sub Service_Create
Main.kvs.Initialize(File.DirInternal,"data")
rv = ConfigureHomeWidget("widget", "rv", 0, "13033",True)
End Sub
Sub Service_Start (StartingIntent As Intent)
rv.HandleWidgetEvents(StartingIntent)
Sleep(0)
Service.StopAutomaticForeground
End Sub
Sub rv_RequestUpdate
rv.UpdateWidget
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub Service_Destroy
End Sub