title: RecognizerIntent: how to add a bundle to a pending intent
body: <p>I am implementing an activity that responds to the <a href="http://developer.android.com/reference/android/speech/RecognizerIntent.html" rel="noreferrer">RecognizerIntent</a>. Among others this activity must handle two incoming extras that specify a pending intent and <em>its</em> extras-bundle:</p>
  
  <ul>
  <li><code>EXTRA_RESULTS_PENDINGINTENT</code></li>
  <li><code>EXTRA_RESULTS_PENDINGINTENT_BUNDLE</code></li>
  </ul>
  
  <p>Paraphrasing the documentation:</p>
  
  <ul>
  <li><p>If you use <code>EXTRA_RESULTS_PENDINGINTENT</code> to supply a <code>PendingIntent</code>, the results will be added to its bundle and the <code>PendingIntent</code> will be sent to its target.</p></li>
  <li><p>If you use <code>EXTRA_RESULTS_PENDINGINTENT</code> to supply a forwarding intent, you can also use <code>EXTRA_RESULTS_PENDINGINTENT_BUNDLE</code> to supply additional extras for the final intent. The search results will be added to this bundle, and the combined bundle will be sent to the target.</p></li>
  </ul>
  
  <p>I have been looking in vain for sample code that would demonstrate the following.</p>
  
  <p><strong>What is the best way of extracting a <code>PendingIntent</code> from a bundle?</strong></p>
  
  <p>Should I do:</p>
  
  <pre><code>(PendingIntent)
          extras.getParcelable(RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT)
  </code></pre>
  
  <p><strong>How to add extras to the set of existing extras of a <code>PendingIntent</code>?</strong></p>
  
  <p><strong>How to launch the modified <code>PendingIntent</code>?</strong></p>