Back to project page Swipelight_Flashlight.
The source code is released under:
Apache License
If you think the Android project Swipelight_Flashlight 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.collinguarino.flashlight; /*from www . j ava 2 s . c om*/ import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; import android.content.Intent; import android.widget.RemoteViews; /** * Created by Collin on 10/1/13. */ public class WidgetProvider extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { super.onUpdate(context, appWidgetManager, appWidgetIds); Intent intent = new Intent(context, Main.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout); views.setOnClickPendingIntent(R.id.widgetView, pendingIntent); appWidgetManager.updateAppWidget(appWidgetIds, views); } }