pomocą metod zwrotnych onEnabled(), onDisabled(), onUpdate(), onDeleted(), onReceive() public class WidgetProvider extends AppWidgetProvider { @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); if (intent.getAction().equals("MY.ACTION")) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); ComponentName thisAppWidget = new ComponentName(context.getPackageName(), WidgetProvider.class.getName()); int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisAppWidget); onUpdate(context, appWidgetManager, appWidgetIds); } } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { // wczytujemy zdalny układ widoków RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); // aktualizujemy zawartość komponentu remoteViews.setTextViewText(R.id.widget_text, "onUpdate " + System.currentTimeMillis()/1000); Intent intent = new Intent(context, WidgetProvider.class); intent.setAction("MY.ACTION"); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); // ustawienie OnClickListenera remoteViews.setOnClickPendingIntent(R.id.widget_image, pendingIntent); // aktualizacja zdalnego widoku appWidgetManager.updateAppWidget(appWidgetIds[0], remoteViews); } }