package com.tryandroid;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.widget.RemoteViews;

public class TryAndroidWidget extends AppWidgetProvider {

	/*
	 * (非 Javadoc)
	 *
	 * @see
	 * android.appwidget.AppWidgetProvider#onUpdate(android.content.Context,
	 * android.appwidget.AppWidgetManager, int[])
	 */
	@Override
	public void onUpdate(Context context, AppWidgetManager appWidgetManager,
			int[] appWidgetIds) {

		for (int id : appWidgetIds) {
			RemoteViews views = new RemoteViews(context.getPackageName(),
					R.layout.appwidget);
			views.setTextViewText(R.id.appwidget_text_view, "Try Android Widget");
			appWidgetManager.updateAppWidget(id, views);
		}
	}

}
