Hello,
I build a small widget that features a Panel1_Click Event with the StartActivity(Main) call.
Unfurtunately, that click event doesn't work after creating the widget.
The click event only works after the widget gets a CallSub(widget, "Widget_check") from an other service.
What can I do to have the Panel1_click working even if the widget has not been called yet from an other service?
Code for the widget is:
After calling from an other service
the Panel1_click works... But how can the click event work without calling the widget from outside?
Best regards,
Carsten
I build a small widget that features a Panel1_Click Event with the StartActivity(Main) call.
Unfurtunately, that click event doesn't work after creating the widget.
The click event only works after the widget gets a CallSub(widget, "Widget_check") from an other service.
What can I do to have the Panel1_click working even if the widget has not been called yet from an other service?
Code for the widget is:
B4X:
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
rv = ConfigureHomeWidget("widglayout.bal", "rv", 0, "Parkzone Dialer Widget", True)
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
Sub rv_RequestUpdate
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub Service_Destroy
End Sub
Sub Widget_check
rv.SetVisible("Label1", True)
rv.SetVisible("ImageView1", False)
rv.SetVisible("Label2", True)
rv.SetText("Label1", Parktime.gesamtminuten)
rv.UpdateWidget
End Sub
Sub Widget_Stop
rv.SetVisible("Label1", False)
rv.SetVisible("ImageView1", True)
rv.SetVisible("Label2", False)
rv.UpdateWidget
End Sub
Sub Panel1_Click
StartActivity(Main)
End Sub
After calling from an other service
B4X:
CallSub(widget, "Widget_check")
the Panel1_click works... But how can the click event work without calling the widget from outside?
Best regards,
Carsten