Back to project page our_days.
The source code is released under:
Apache License
If you think the Android project our_days 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.yemyatthu.ourdays.widget; //from w w w . j a v a 2 s . co m import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; import android.content.Intent; import android.widget.RemoteViews; import com.yemyatthu.ourdays.R; import com.yemyatthu.ourdays.activity.MyConfigActivity; /** * Created by YMT on 10/12/2014. */ public class LoveWidgetProvider extends AppWidgetProvider { @Override public void onEnabled(Context context) { super.onEnabled(context); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { super.onUpdate(context, appWidgetManager, appWidgetIds); for(int i = 0;i <appWidgetIds.length;i++){ int appWidgetId = appWidgetIds[i]; Intent intent = new Intent(context, MyConfigActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout); views.setOnClickPendingIntent(R.id.widget_layout, pendingIntent); appWidgetManager.updateAppWidget(appWidgetId, views); } } }