Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid set ringtone (Call, Notification, Alarm) from mp3 on raw folder
    text
    copied!<p>I wanna set a <code>mp3</code> from my <code>raw</code> folder to <code>ringtone, notification and alarm</code>, I have a switch and this sentences:</p> <pre><code>public void onClick(DialogInterface dialog, int item) { Uri path = Uri.parse("android.resource://com.genaut.instantbuttonsfreak/raw/"+sonidoActual); switch(item){ case 0: RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE, path); //RingtoneManager.getRingtone(getApplicationContext(), path).play(); Log.d("RutaTONO", RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE).toString()); break; case 1: RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_NOTIFICATION, path); break; case 2: RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_ALARM, path); break; } } </code></pre> <p>Well, on <code>case 0</code>, The first line set the sound to default call ringtone, the second line play the sound and the third shows a log with the uri, all this works fine, or I think it.</p> <p>The problem is that the sound dont play when my phone is called, notified or "alarmed". Sorry my bad english.</p> <p>I have this <code>uses-permissions</code>:</p> <pre><code>&lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt; &lt;uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /&gt; &lt;uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /&gt; &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; </code></pre> <p>Always I change this, the soud is my mobile default sound :S</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload