title: PendingIntent to launch and stop a Service
body: <p>I'm trying to make a simple widget with a button that start a <code>Service</code> with the <code>OnClickPendingIntent()</code>. I can start it fine but I can't figure out a way to stop it (I know I can do it with a <code>BroadcastReceiver</code> or something similar but I would like to avoid hardcode).</p>
  
  <p>This is my code:</p>
  
  <pre><code>        Intent intent = new Intent(context, myService.class);
          PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);
  
          RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.my_widget);
  
          if (!ismyserviceup(context)) {
              views.setOnClickPendingIntent(R.id.my_button, pendingIntent);
          } else {
              // i need to stop it!!!!
          }
  </code></pre>