My application is updated inside the service and first does this to get the widget id:
AppWidgetManager widgetManager = AppWidgetManager.getInstance(this); int[] widgetIds = widgetManager.getAppWidgetIds(new ComponentName(this, WidgetReceiver.class));
Sometimes this method returns an empty array, although the widget is still on the main screen. I searched around and couldn't find anything about it. The problem is that this does not always happen, only sometimes (although when it happens, when it seems that it will not be successful in subsequent attempts to update).
Has anyone ever come across this, and even better found a solution? Very much appreciated.
source share