@Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { // There may be multiple widgets active, so update all of them for (int appWidgetId : appWidgetIds) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget_empty); Intent intent = new Intent(context, MainActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.appwidget_root, pendingIntent); appWidgetManager.updateAppWidget(appWidgetId, views); } // tell service to update all widgets JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, new Intent()); }
@Override public void onReceive(Context context, Intent intent) { JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent); }
@Override public void onReceive(Context context, Intent intent) { JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent); }