K korshkov Member Licensed User Longtime User Nov 24, 2012 #1 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: Nov 25, 2012
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2012 #2 You can extract the widget ID from the intent. Add the following code to see the values: Code: Copy Log(StartingIntent) Log(StartingIntent.ExtrasToString) Upvote 0
You can extract the widget ID from the intent. Add the following code to see the values: Code: Copy Log(StartingIntent) Log(StartingIntent.ExtrasToString)
K korshkov Member Licensed User Longtime User Nov 25, 2012 #3 When Service_Start i write: Code: Copy 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 Code: Copy rv_RequestUpdate rv.HandleWidgetEvents Log("MyViewID: " & MyViewID) MyViewID in all widgets copy is identical... How receive Intent parameter in Lablel1_Click? Upvote 0
When Service_Start i write: Code: Copy 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 Code: Copy rv_RequestUpdate rv.HandleWidgetEvents Log("MyViewID: " & MyViewID) MyViewID in all widgets copy is identical... How receive Intent parameter in Lablel1_Click?
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2012 #4 After a more thorough check, I don't think that it will currently work. Currently you cannot distinguish between multiple instances of the same widget. Upvote 0
After a more thorough check, I don't think that it will currently work. Currently you cannot distinguish between multiple instances of the same widget.