Alex, Can you be more specific on what you truly want to do? Are you trying to write an activity that offers a higher level of control over the playing of media on the device? Or are you concerned about a MediaPlayer already running on the device when your activity starts? If the latter, then I think an already-running, well-behaved application that uses MediaPlayer should stop, or offer some sort of option, when its onPause() is called. That ought to stop the playing of media when your app is being launched. If the former, then I don't think it's possible (yet at least).
You really don't want to be integrating with every possible media application the user could install. At the same time, I'm not sure that Android has enough capabilities to manage the interaction of apps on a mobile device. I can imagine situations where I'm okay with my music player to keep playing while I do something else (doing email, surfing the web), and other situations where I'm not okay with it (taking a phone call). It's a difficult problem to solve given all of the combinations of apps and what they might do with the playing of media. - dave On Dec 24, 7:16 am, Mark Murphy <[email protected]> wrote: > Alex Corbi wrote: > > Thanks for the tipp moneytoo, i will check that out. > > > Mark, is it allowed to use the method that moneytoo suggests? > > I misunderstood your question -- I thought you were looking to play back > media, not just stop and start an existing player. > > That being said, please understand that: > > 1. The broadcast Intents that moneytoo refers to, for the built-in > Android media player, are undocumented and not part of the SDK, so you > should not use them: > > http://www.androidguys.com/2009/12/14/code-pollution-reaching-past-th... > > 2. This only affects the built-in Android media player (and, perhaps, > the HTC modified player). Any other media player -- StreamFurious, > Pandora, etc. -- will not honor them and probably does not offer its own > equivalents. > > > is it at least possible to know whether some media is currently being > > played? a isPlaying() method or something? > > No, because there is an infinite number of possible media players. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Beginning Android_ from Apress Now Available! -- 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

