Android widget and two different PendingIntents
<p>Here's what I'm trying to achieve:
Widget with 3 buttons:
1. View folder
2. Add item
3. Add item and start a camera to attach a photo to the item.</p>

<p>I was hoping to achieve 2&amp;3 by using an Intent with extras, just add a boolean extra "photo" to hold true if the 3rd button was clicked, here's my code:</p>

<pre><code>Intent intent = new Intent(Intent.ACTION_INSERT);
        intent.setData(Uri.parse("content://"
                + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId));
intent.putExtra("photo", false);
intent.putExtra("kind", "NO PHOTO");
intent.setAction(Intent.ACTION_INSERT);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
views.setOnClickPendingIntent(R.id.imageButton2, pendingIntent);

Intent intentFolder = new Intent(Intent.ACTION_VIEW);
        intentFolder.setData(Uri.parse("content://"
                + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId + "/notes"));
PendingIntent pendingIntentFolder = PendingIntent.getActivity(this, 0, intentFolder, 0);
Intent intentPhoto = new Intent(Intent.ACTION_INSERT);
intentPhoto.setData(Uri.parse("content://"
        + NoteProviderMetaData.AUTHORITY + "/folders/"
                + folderId));
intentPhoto.putExtra("photo", true);
intentPhoto.putExtra("kind", "PHOTO");
intentPhoto.setAction(Intent.ACTION_INSERT);
PendingIntent pendingIntentPhoto = PendingIntent.getActivity(this, 0, intentPhoto, 0);
views.setOnClickPendingIntent(R.id.imageButton3, pendingIntentPhoto);
</code></pre>

<p>The problem is that immediately after I create <code>pendingIntentPhoto</code> my <code>pendingIntent</code> extras are overridden by new values and I always get <code>true</code> and <code>PHOTO</code> values in my activity.
<code>pendingFolder</code> intent works, so I guess it would be fine just to use another intent action but I'd like to understand how this PendingIntent thing works.</p>
