<What is the best way to play an alarm ringtone wh...
# stackoverflow
u
What is the best way to play an alarm ringtone when broadcast reciever is called? I am having trouble finding the best way to activate an alarm tone. My broadcast receiver is called, the media player starts, but then stops. after about a second when my alarm app is closed and not open in recent apps. It will play continuously if the alarm app is open. Does anyone know the best way to play a sound once a alarm broadcast receiver goes off? what I am currently using in the broadcast receiver. val mediaPlayer1 = MediaPlayer.create(context2, R.raw.geese)...