Home

Published

- 1 min read

how to play ringtone in android

img of how to play ringtone in android

The solution for this is noted below

how to play ringtone in android

Solution

   val ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
val ringtoneSound: Ringtone = RingtoneManager.getRingtone(requireContext(), ringtoneUri)
ringtoneSound.play()

Try other methods by searching on the site. That is if this doesn’t work