[android-developers] Re: Find whether any audio is currently playing

2009-05-25 Thread iDeveloper
Thanks a lot for the answers. I like the idea of a singleton class the best. Thanks again. On 23-May-09, at 12:58 PM, Doug wrote: > > Well, seems like you have a couple of issues. > > 1) Re-instantiation of your activity that contains the player... if > you're going to put the mediaplayer in

[android-developers] Re: Find whether any audio is currently playing

2009-05-25 Thread Doug
Well, seems like you have a couple of issues. 1) Re-instantiation of your activity that contains the player... if you're going to put the mediaplayer in an activity and want to re- launch that activity why not use the 'singleTop' or 'singleTask' flags in your manifest - (each has a specific use)

[android-developers] Re: Find whether any audio is currently playing

2009-05-24 Thread Rob Franz
Only way you can actually stop it is to do so through the MediaPlayer... unless I have missed something. You can *mute* the audio by calling the setStreamMute method - but can't stop it. I can see why it works like this, too - there's no reason why it shouldn't work like this. I have been runnin

[android-developers] Re: Find whether any audio is currently playing

2009-05-23 Thread Marco Nelissen
On Fri, May 22, 2009 at 9:57 PM, iDeveloper wrote: > Thanks. > And how do I stop the audio from playing if isMusicActive() returns true? > Do I have to use the MediaPlayer instance? But the instance won't be in > memory any longer as the activity has been exited once and a new instance of > the a

[android-developers] Re: Find whether any audio is currently playing

2009-05-22 Thread iDeveloper
Thanks. And how do I stop the audio from playing if isMusicActive() returns true? Do I have to use the MediaPlayer instance? But the instance won't be in memory any longer as the activity has been exited once and a new instance of the activity created in order to come back. Thanks again.

[android-developers] Re: Find whether any audio is currently playing

2009-05-22 Thread Rob Franz
You can detect whether audio is playing by getting a reference to AudioManager and calling isMusicActive()... -Rob On Fri, May 22, 2009 at 11:04 AM, Marco Nelissen wrote: > On Thu, May 21, 2009 at 9:41 PM, iDeveloper wrote: > >> Hi >> >> I am using a MediaPlayer instance in order to stream audio

[android-developers] Re: Find whether any audio is currently playing

2009-05-22 Thread Marco Nelissen
On Thu, May 21, 2009 at 9:41 PM, iDeveloper wrote: > Hi > > I am using a MediaPlayer instance in order to stream audio files from an > Internet location. The audio player is in a separate activity. The user can > select from a list of audio files and come to this activity which plays the > audio.