My issue is that the code is not changing my Alarm tone, or the tone for when I get a text message.
The following works:
private void setRingTone(int RawId, String HumanName, String fileName)
{
Uri path = Uri.parse("android.resource://"+ getPackageName() +"/raw/" + fileName);
RingtoneManager.setActualDefaultRingtoneUri(
getApplicationContext(), RingtoneManager.TYPE_RINGTONE,
path);
Log .i("TESTT", "Ringtone Set to Resource: "+ path.toString());
RingtoneManager.getRingtone(getApplicationContext(), path)
.play();
}
However these 2 do not:
-
private void setTextTone(int RawId, String HumanName, String fileName)
{Uri path = Uri.parse("android.resource://"+ getPackageName() +"/raw/" + fileName); RingtoneManager.setActualDefaultRingtoneUri( getApplicationContext(), RingtoneManager.TYPE_NOTIFICATION, path); Log .i("TESTT", "Ringtone Set to Resource: "+ path.toString()); RingtoneManager.getRingtone(getApplicationContext(), path) .play();}
Does anyone know why the Notification does not change the sound of SMS messages, but Ringtone works. It is basically the same code??
EDIT I found something on Stack Overflow here (But I do Not understand it can someone clarify?) http://stackoverflow.com/questions/9545906/how-do-i-change-the-android-sms-tone-despite-of-current-sms-tone-setting
Thanks in Advance!
So the solution is to copy the sound from the raw folder into the sdcard and from there do the following: