I do indeed need that.

What I'm trying to do is:
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

So to achieve that I found out that I have to use a PendingIntent, but or 
the id of the pending-intent I use the id of the widget (because per widget 
the user needs to be able to start the process). And I do that I have to 
use the FLAG_UPDATE_CURRENT, so the pending intent is updated (and not 
removed or whatever) when the user presses the button.
A second reason to use the FLAG_UPDATE_CURRENT is to not loose the 
PendingIntent when it's fired once. Whit this I mean when the user presses 
the button, he can still cancel his action (in the activity that opened he 
just presses the back button of the device). But doing this with the 
PendingIntent.FLAG_ONE_SHOT will make that when the user presses again that 
button on the widget my activity is no longer executed. Or should I do this 
another way...?

Op dinsdag 17 juli 2012 21:14:18 UTC+2 schreef TreKing het volgende:
>
> On Tue, Jul 17, 2012 at 8:35 AM, Dirk Vranckaert <dirkvrancka...@gmail.com
> > wrote:
>
>> However if I start it with the PendingIntent with the flag set to 
>> PendingIntent.FLAG_UPDATE_CURRENT part of my flow is not executed anymore
>>
>
> Why are you using UpdateCurrent? Do you have extras in the intent that 
> need to be updated?
>
>
> -------------------------------------------------------------------------------------------------
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to