Question: I'm using a RingtoneManager with RingtonePreference. When I use the default Ringtone, there is no problem, but when i use a configured Ringtone, it's playing for minutes... I don't know if the song's duration is minutes or if it plays in a loop... 

here my code:

```
private static void playNotificationSound(Context context) {
    RingtoneManager rm  = new RingtoneManager(context);
    String ringtone = MySharedPreferences.ringtone(context);
    Uri uri = null;
    if(ringtone == null)
        uri = RingtoneManager
            .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    else
        uri = Uri.parse(ringtone);
    if (uri != null) {
        Ringtone rt = RingtoneManager.getRingtone(context, uri);
        if (rt != null) {
            rt.setStreamType(AudioManager.STREAM_NOTIFICATION);
            rt.play();
        }
    }
}

```

I use it to play a song with a notification and I don't want the phone to play for 5minutes...

Answer: 
Try adding the following Line.

```
ringtoneManager.stopPreviousRingtone();

```
I found another solution, I set the notification.sound = uri; 
and don't use the RingtoneManager anymore.

with notification.flags |= Notification.FLAG\_AUTO\_CANCEL | Notification.FLAG\_ONLY\_ALERT\_ONCE;

but the songs still plays in a loop. Maybe the ringtones really are 5minutes long? Or is it possible for a ringtone to be configured as a loop song?