I am using MediaPlayer
class to play sound. But there is an issue in my code. If headset is connected is connected to my device and then it play sound on headset, not on device speaker.
So my question is how to play sound both in device speaker and headset, if headset is still connected to the device.
Code used to play sound
m_MediaPlayer = MediaPlayer.create(SettingsAlarmToneActivity.this, R.raw.tone1);
m_MediaPlayer.start();