Code example for RemoteViews

0
	private static SilentAlarm silentTimerAlarm;
	private static final String PACKAGE_NAME = "net.danielkvist.SilentTimer";
	private static final int WIDGET_RESOURCE_ID = R.layout.widget;
	private boolean enabled = true;
	 
	RemoteViews updateViews = new RemoteViews(PACKAGE_NAME, WIDGET_RESOURCE_ID);
	 
	/** 
	 * Runs when the widget updates 
	 */ 
	@Override 
	public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) 
	{ 
		super.onUpdate(context, appWidgetManager, appWidgetIds);
 
		final int N = appWidgetIds.length;
		for (int i = 0; i < N; i++) 
		{ 
			int appWidgetId = appWidgetIds[i];
			updateAppWidget(context, appWidgetManager, appWidgetId);
		}