Start/Stop Service from Widget
问题 I want to start a service from inside the widget, I know that i can do it using PendingIntent like PendingIntent intent = PendingIntent.getService(context, 0, new Intent(context, MyService.class), Intent.FLAG_ACTIVITY_NEW_TASK); remoteViews.setOnClickPendingIntent(R.id.buttonWidgetStartService, intent); but the problem is that I've already used PendingIntent on that button for some other purpose. So, I tried starting the service using context.startService(new Intent(context, MyService.class))