How to change the code notification sound in android?

Does anyone know how to change the code notification sound in android. I managed to set the default melody, but could not find a way to adjust the notification tone ...

I would be grateful for any answer, like sample code, psudo code, or just the name of the sdk part that I should use ...

+5
source share
4 answers

You can control this based on Notificationthe sound field.

+2
source

here

RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_NOTIFICATION,      uriObjectofYourAudioFile);
+9
source

notification.sound = Uri.parse("android.resource://com.packagename.org/raw/alert");
+4
source

A good example of how to use the notification bar, customize sounds and LEDs can be found in this tutorial:

http://www.firstdroid.com/2010/05/09/learn-by-example-using-notification-bar/

Hope this helps, Adrian.

0
source

All Articles