title: get song name while running in the background?
body: <p>Is there a way for my android app to run in the background and perform an action when the current media being played matches some variable? for example:</p>
  
  <pre><code>String songThatIWant = "Killer Queen";
  
  if (songThatIsCurrentlyPlaying = songThatIWant)
  {
       //do stuff
  }
  </code></pre>
  
  <p>but in the background? I'm planning to have my app send a notification asking if i want the lyrics to the song if it knows it when the song starts playing. Would I put the code in MainActivity.java, or would I create a separate activity specifically for running in the background? Thanks :)</p>