title: How to use Actions from Notification without starting Activity
body: <p>So I'm working on a simple music player. The music player as it names states, can play a song, pause playback, forward to next song, go back to previous song, and stop playback completely. When you play a song, there will be a notification displayed with the Artist Name, and the Song Name; this notification also has three buttons (Actions): Stop, Pause an Next. </p>
  
  <p>What I'm having issues with is making sure that when either action is clicked, the playback control related to the Action is triggered, and well, I have absolutely no idea on how to do that. I searched the Android Notification: <a href="http://developer.android.com/guide/topics/ui/notifiers/notifications.html">http://developer.android.com/guide/topics/ui/notifiers/notifications.html</a> but It does not clarifies, or dedicates too much info on Notification Actions. </p>
  
  <p>Here is a simple action for instance (which should be associated with the "Next" button click on the notification: <strong>Note:</strong> All of the code described below is written under the following package: <strong>com.deadpixels.light.player</strong> and the Activity is called: <strong>PlayerActivity</strong></p>
  
  <pre><code>public void nextSong() {
      if (position == songs.size() -1) {
          Toast.makeText(this, "No more songs on queue", Toast.LENGTH_SHORT).show();
          if(mPlayer.isPlaying()) {
              return;
          }
          else {
              buttonPlay.setImageResource(R.drawable.button_play);
          }
          return;
      }
      else {
          position++;
          playSong(songs.get(position));
      }
  }
  </code></pre>
  
  <p>Here is what I tried to do:</p>
  
  <pre><code>Intent nextIntent = new Intent(KEY_NEXT);
  PendingIntent nextPendingIntent = createPendingResult(0, nextIntent, 0);
  </code></pre>
  
  <p>Where the action for the NextIntent is: </p>
  
  <pre><code>public static final String KEY_NEXT = "com.deadpixels.light.player.PlayerActivity.nextSong";
  </code></pre>
  
  <p>and then I add that to the Notification via addAction(): </p>
  
  <pre><code>mBuilder.addAction(R.drawable.not_action_next, "Next", nextPendingIntent);
  </code></pre>
  
  <p>Do you guys know what else I could try? Using what I explained above does nothing at all, the notification shows up, and has three action buttons, but clicking on them does nothing for me. </p>
  
  <p>At one point I thought maybe if I added the intent filters with the action names, but then I thought, well, they are all on the same namespace, why should I?</p>