How to repeat the ringtone

I use ringtone = RingtoneManager.getRingtone (this, Settings.System.DEFAULT_RINGTONE_URI); get the default ringtone and I play with ringtone.play (); This reproduction of a melody only once, I wanted to play until I called ringtone.stop (); i can see in log

12-10 18:37:40.968: DEBUG/Ringtone(2874): playing a tone with looping : false 

is there any way to loop?

the next is my code,

 ringtone = RingtoneManager.getRingtone(this,Settings.System.DEFAULT_RINGTONE_URI); ringtone.setStreamType(AudioManager.STREAM_NOTIFICATION); ringtone.play(); 
+6
source share
1 answer

There is a loop flag built into the sound file itself. Your ringtone may not be set by default.

Further information here:

http://xanderx.com/2010/08/25/making-ringtones-loop-on-android/

0
source

Source: https://habr.com/ru/post/903514/


All Articles