title: Play sound in speaker while headphone is connected
body: <p>How to play sound in speaker while a <code>headphone</code> or <code>Bluetooth headset</code> is connected?</p>
  
  <p>I have tried the code below, but still the same:</p>
  
  <pre><code>AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
  audioManager.setMode(AudioManager.STREAM_MUSIC);
  audioManager.setSpeakerphoneOn(true);
  </code></pre>