1

I was able to set ringtone and notification with this method:

RingtoneManager.setActualDefaultRingtoneUri(context, type, ringtoneUri)

But when type is RingtoneManager.TYPE_ALARM, it doesn't change the alarm sound? Do I have to do anything extra?

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.figengungor.soundboard">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="MODIFY_AUDIO_SETTINGS"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".ui.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108

1 Answers1

0

Change

<uses-permission android:name="MODIFY_AUDIO_SETTINGS"/>

to

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
Yuliwee
  • 327
  • 1
  • 11