title: Android - find whether audio is currently playing and stop it
body: <p>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 to play the audio.</p>
  
  <p>Now the user might go back to the previous activity (with the list) and select another audio file. In this case, I want to stop any other audio that is playing and start playing the new audio which was selected.</p>
  
  <p>Is there any way I can know whether an audio file is playing without having to hold on to the MediaPlayer object?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I did find out how to know whether an audio is playing.
  We can do it by using an object of AudioManager and calling isAudioPlaying(). This will return a true if any audio is playing.</p>
  
  <p>Now the other question, <strong>how do I stop an audio currently playing?</strong> I do not have an instance of the MediaPlayer object which was created to start the audio (coz the user has already left the activity once and has come back with a new object of the activity and thus a new instance of the MediaPlayer)</p>