I'm trying to create individual instances from homescreen widgets with the possibility to set individual values for the different widgets.
I took a quick look into the RemoteViewsWrapper of the core library.
Wouldn't it be possible to just update a special widget with the following new method in the core library?
With this it should be possible to update a single widget with the given ID.
You can get the AppWidgetId(s) from the Intent. If the service is called manually we would need another method to get the appwidget Ids:
Erel, what do you think?
I took a quick look into the RemoteViewsWrapper of the core library.
Wouldn't it be possible to just update a special widget with the following new method in the core library?
B4X:
public void UpdateWidgetWithId(BA ba, int WidgetId)
throws ClassNotFoundException
{
checkNull();
AppWidgetManager.getInstance(ba.context).updateAppWidget(WidgetId, this.current);
this.current = null;
}
With this it should be possible to update a single widget with the given ID.
You can get the AppWidgetId(s) from the Intent. If the service is called manually we would need another method to get the appwidget Ids:
B4X:
public int[] GetAppWidgetIds(BA ba) throws ClassNotFoundException {
ComponentName cn = new ComponentName(ba.context,
Class.forName(BA.packageName + "." + ba.className + "$" + ba.className + "_BR"));
return AppWidgetManager.getInstance(ba.context).getAppWidgetIds(cn);
}
Erel, what do you think?
Last edited: