I create a timer app and that code was play the alarm sound but how can I stop it? xD I use that code for playing:
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
Ringtone ringtoneSound = RingtoneManager.getRingtone(getApplicationContext(), ringtoneUri)
if (ringtoneSound != null) {
ringtoneSound.play();
}
So I want to click the reset button and its stop, its how possible? Many thanks, Dominik.
You can check first if the ringtone is playing, only then you stop it.