To use the user's default sound, add "DEFAULT_SOUND" to the defaults field:
notification.defaults |= Notification.DEFAULT_SOUND;
But...actually, I can't make my Emulator to have any sound using this method. May be there are some setting missed in my Emulator.
(If you know why, please leave me a comment to let me know, thx.)
Alternatively, I use a mp3 file in sdcard as Notification sound.
- Follow my previous articles to Create an SD Card to existing AVD, and Copying Files to a Disk Image, to copy a mp3 file to the root of the sdcard, named sound.card.
- Add the code in the Activity.
notification.sound = Uri.parse("file:///sdcard/sound.mp3");
Thank you for reading this article Use mp3 as Notification sound With URL https://x-tutorials.blogspot.com/2009/10/use-mp3-as-notification-sound.html. Also a time to read the other articles.
0 comments:
Write your comment for this article Use mp3 as Notification sound above!