title: Android - using AudioManager to play/pause music?
body: <p>My question is how can I use the AudioManager class to 1) see if a music service is open, and 2) if it's paused, play it, if it's playing, pause it..? </p>
  
  <p>So far all I've really done is initialize an instance of it:</p>
  
  <pre><code>AudioManager AM = (AudioManager) getSystemService(AUDIO_SERVICE); 
  if (AM.isMusicActive()) {
      //how do I pause whatever music player is active?       
  }
  </code></pre>
  
  <p>Similarly, if a music player is open and paused, how do I play it? I've looked into the MediaPlayer class but I'm not sure how to use it with AudioManager (or if I even want to). While I'm asking questions, is there manifest permissions I need to worry about?</p>
  
  <p>Thanks guys! </p>