Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.media.RingtoneManager; import android.net.Uri; public class Main { /** * 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); } }