Set the Default Notification Ringtone to the given URI. - Android Android OS

Android examples for Android OS:Notification

Description

Set the Default Notification Ringtone to the given URI.

Demo Code


//package com.java2s;
import android.content.Context;

import android.media.RingtoneManager;
import android.net.Uri;

public class Main {
    /**//ww w .  ja v a 2s .  c o  m
     * Set the Default Notification Ringtone to the given URI.
     * @param ctx
     * @param uri URI of a row in MediaStore
     */
    public static void setDefaultNotificationRingtone(Context ctx, Uri uri) {
        RingtoneManager.setActualDefaultRingtoneUri(ctx,
                RingtoneManager.TYPE_NOTIFICATION, uri);
    }
}

Related Tutorials