Hello,
I'm testing out the widgets and I have a question.
1) Is it possible to add views to a widget by code as I need this very hard for my app :s
Example:
I really need this. Is there a possible way to do this?$
Can you make your widget name a customizable string?
2)
Thanks,
XverhelstX
I'm testing out the widgets and I have a question.
1) Is it possible to add views to a widget by code as I need this very hard for my app :s
Example:
B4X:
Sub Process_Globals
Dim rv As RemoteViews
Dim strWidgetName As String
End Sub
Sub Service_Create
Dim Panel1 As Panel
Panel1.Initialize("p1")
Dim btn1 As Label
btn1.Initialize("btn1")
btn1.BringToFront
btn1.Text = "This is a label"
Panel1.addview(btn1,5,5,100,50)
'Panel 1 is the widget in the designer
rv = ConfigureHomeWidget("Widget", "rv", 0, "Widget")
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
I really need this. Is there a possible way to do this?$
Can you make your widget name a customizable string?
2)
Compiling code. Error
Error compiling program.
Error description: A string constant is expected.
Occurred on line: 45
rv = ConfigureHomeWidget("Widget", "rv", 0, strWidgetName)
Word: strwidgetname
Thanks,
XverhelstX