Code example for AppWidgetManager

Methods: getAppWidgetIds

	protected void initWidetService(Context context, AppWidgetManager appWidgetManager) {
		ComponentName thisWidget = new ComponentName(context, Widget41.class);
		int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
		// Build the intent to call the service 
		Intent intent = new Intent(context.getApplicationContext(), WidgetService41.class);
		intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);
		// Update the widgets via the service 
Stop searching for code, let great code find you!  Add Codota to your java IDE