On Wed, Jul 18, 2012 at 1:48 AM, Dirk Vranckaert
<[email protected]>wrote:

> 1) I have a widget with a button, on the button I want to put the
> PendingIntent that I showed in my first post.
> 2) Then when the user presses that button, an action happens (something is
> started), and I want to change the PendingIntent on the button to something
> new (another activity and different extras) in order to create a 'stop'
> button
> 3) When the stop button is pressed I again change the PendingIntent to the
> one from step 1
>

I do pretty much the exact same thing with my widget. Instead of using
extras to pass the widget ID, use the Data element:

http://developer.android.com/reference/android/content/Intent.html#setData%28android.net.Uri%29

Or use two different actions ("start" and "cancel", for example). This
makes each PendingIntent unique and they wrote overwrite each other and you
won't need UPDATE_CURRENT.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to