How to use the Android speaker ignoring the Android Studio Headphones

1

I'm making an application that works like an alarm, the problem is that when I play the audio that I set as an alert if the headphones are connected it uses them as an audio output, how can I make it sound in the main speaker ignoring the hearing aids?

So I sound the audio:

MediaPlayer mp = MediaPlayer.create(this, R.raw.alarma);
mp.start();

Thanks for the help.

    
asked by karasu55 23.08.2018 в 17:32
source

0 answers