title: Doing something if it detects that headphones are plugged in
body: <p>I'm wanting to make it so if headphones are plugged in the device something happens such as a notification icon appears. (I already have the notification icon stuff done) But I can't seem to find a way to make it happen. I'm wanting something like this </p>
  
  <pre><code>if headphones_plugged_in {
  do this 
  }
  </code></pre>
  
  <p>I found this online </p>
  
  <pre><code>AudioManager.isWiredHeadsetOn()
  </code></pre>
  
  <p>I just don't know how I would use that. I already added the right permissions in the manifest too! If you could guide me or link me to something it would be great. Thank You!</p>