Get appWidgetId (or use some copy ONE widget)

korshkov

Member
Licensed User
Longtime User
Hello!
Please help me.
I create one widget and place on home screen some copy.
How get unique id for each? I want display different content with different setting using ONE created widget.
On android developer site write about appWidgetId.
How to use this attribute on b4a?
Thanks.
 
Last edited:

korshkov

Member
Licensed User
Longtime User
When Service_Start i write:
B4X:
If StartingIntent.Action = "android.appwidget.action.APPWIDGET_UPDATE_OPTIONS" Then
      MyViewID = StartingIntent.GetExtra("appWidgetId")
      rv.SetText("Label3", MyViewID)
End If
MyViewID defined in Process_Globals

Only when i view log in Label1_Click
B4X:
rv_RequestUpdate
rv.HandleWidgetEvents
Log("MyViewID: " & MyViewID)
MyViewID in all widgets copy is identical...


How receive Intent parameter in Lablel1_Click?
 
Upvote 0
Top