Skip to content Skip to sidebar Skip to footer

Set Default Alarm Sound Programatically Android

I've been trying to define the default alarm sound but with no success! I can sucessfully change the ringtone and the notification sound but the alarm doesn't change at all... I'm

Solution 1:

Try this

 try {
            RingtoneManager.setActualDefaultRingtoneUri(getContext(),
                    RingtoneManager.TYPE_ALARM, newUri);
            Settings.System.putString(mCr, Settings.System.ALARM_ALERT,
                    newUri.toString());
            Toast.makeText(getContext(), "Done", Toast.LENGTH_SHORT).show();

        } catch (Throwable t) {

        }

Post a Comment for "Set Default Alarm Sound Programatically Android"