I have a simplest implementation of a widget, codes for activity and service are below.
Appreciate anyone can explain some of my observations:
1) The activity is closed after it is created, but I can still see the activity name ("abc") in the list of running app in the Settings. It is registered there as long as my phone is on.
2) My phone came with several widgets, such as weather, etc..
Upon startup, I can see these widgets in the running app list, but they soon disappear.
Are there special widgets and standard widgets ?
3) The widget service StartAtBoot is not relevant because it is a widget and always start at boot ?
Appreciate anyone can explain some of my observations:
1) The activity is closed after it is created, but I can still see the activity name ("abc") in the list of running app in the Settings. It is registered there as long as my phone is on.
2) My phone came with several widgets, such as weather, etc..
Upon startup, I can see these widgets in the running app list, but they soon disappear.
Are there special widgets and standard widgets ?
3) The widget service StartAtBoot is not relevant because it is a widget and always start at boot ?
B4X:
#Region Module Attributes
#ApplicationLabel: abc
#End Region
Sub Process_Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.Finish
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
B4X:
Sub Process_Globals
Dim rv As RemoteViews
Dim myBeeper As Beeper
End Sub
Sub Service_Create
rv = ConfigureHomeWidget("L1", "rv", 0, "xyz") 'Layout is just an empty panel
myBeeper.Initialize(2000, 500)
End Sub
Sub Service_Start (StartingIntent As Intent)
myBeeper.beep
End Sub
Sub rv_RequestUpdate
End Sub
Sub rv_Disabled
End Sub
Sub Service_Destroy
End Sub