Back to project page Easy-Weather-Android-App.
The source code is released under:
GNU General Public License
If you think the Android project Easy-Weather-Android-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.keepiteasy.easyweather; //from w w w .j a va 2 s . co m import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; import android.widget.RemoteViews; public class WidgetProvider extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { ComponentName thisWidget = new ComponentName(context, WidgetProvider.class); ConditionsObject conditions = Forecast.getConditionsObject(); for (int widgetId : appWidgetManager.getAppWidgetIds(thisWidget)) { RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); remoteViews.setTextViewText(R.id.tempTextView, conditions.getIcon() + " " + conditions.getTemp() + "K"); remoteViews.setTextViewText(R.id.cityTextView, conditions.getCity()); appWidgetManager.updateAppWidget(widgetId, remoteViews); } } }