Don't modify that Intent. It is maintained for you by the system, and the original Intent will be restored whenever the activity is restarted.
Also don't use setIntent(). My arm was twisted to have that added. I should have pushed back harder. :) It is likely to only result in subtle bugs (like this one here). On Thu, Feb 17, 2011 at 9:50 AM, Moto <[email protected]> wrote: > I have a media application which starts playback when the intent is sent to > the player activity with the following intent extras; data "path to the > music" and type "mime/audio format". > > I pick up the intent data at the player activity execute to start playback > and I remove the passed extras from the intent to avoid having the same > request going again after flipping the screen or the activity being brought > back to the foreground. > > This is how I process an intent: > > final String data = getIntent().getDataString(); > final String type = getIntent().getType(); > > // start playback > requestPlay( data, type ); > > // remove intents because they are needed only once per call! > this.getIntent().setDataAndType(Uri.parse(""), ""); > this.getIntent().removeExtra("data"); > this.getIntent().removeExtra("type"); > > The issue I'm having is that randomly and rarely, I will open the > application and when it resumes at the player activity, the intent will > contain the previous extra data and start playing... This is annoying to me > and well my users... > > Anyone have any ideas what's the best way to clear the intents data? Some > reason the ActivityManager might be keeping this data stored...? > > Thanks! > > -- > 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 -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

