Source:
<code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { <START> final int N = appWidgetIds.length; <END> for (int i = 0; i < N; ++i) { Intent serviceIntent = new Intent(context, WidgetService.class); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]); serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME))); RemoteViews widget = new RemoteViews(context.getPackageName(), R.layout.bookmarks_widget); Intent intent = new Intent(context, QuranDataActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.WidgetIconButton, pendingIntent); intent = new Intent(context, SearchActivity.class); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.WidgetBtnSearch, pendingIntent); intent = new Intent(context, PagerActivity.class); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.WidgetBtnGoToQuran, pendingIntent); widget.setRemoteAdapter(appWidgetIds[i], R.id.listViewWidget, serviceIntent); Intent clickIntent = new Intent(context, PagerActivity.class); PendingIntent clickPI = PendingIntent .getActivity(context, 0, clickIntent, PendingIntent.FLAG_UPDATE_CURRENT); widget.setPendingIntentTemplate(R.id.listViewWidget, clickPI); widget.setEmptyView(R.id.listViewWidget, R.id.empty_view); appWidgetManager.updateAppWidget(appWidgetIds[i], widget); } super.onUpdate(context, appWidgetManager, appWidgetIds); }</code><technical_language>variable name - ex numWidgets widgets count</technical_language>

Target:
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int numWidgets = appWidgetIds.length; for (int i = 0; i < numWidgets; ++i) { Intent serviceIntent = new Intent(context, WidgetService.class); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]); serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME))); RemoteViews widget = new RemoteViews(context.getPackageName(), R.layout.bookmarks_widget); Intent intent = new Intent(context, QuranDataActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.widget_icon_button, pendingIntent); intent = new Intent(context, SearchActivity.class); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.widget_btn_search, pendingIntent); intent = new Intent(context, PagerActivity.class); pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); widget.setOnClickPendingIntent(R.id.widget_btn_go_to_quran, pendingIntent); widget.setRemoteAdapter(appWidgetIds[i], R.id.list_view_widget, serviceIntent); Intent clickIntent = new Intent(context, PagerActivity.class); PendingIntent clickPendingIntent = PendingIntent .getActivity(context, 0, clickIntent, PendingIntent.FLAG_UPDATE_CURRENT); widget.setPendingIntentTemplate(R.id.list_view_widget, clickPendingIntent); widget.setEmptyView(R.id.list_view_widget, R.id.empty_view); appWidgetManager.updateAppWidget(appWidgetIds[i], widget); } super.onUpdate(context, appWidgetManager, appWidgetIds); }