Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uri to default sound notification?

I use the Notification.Builder to build a notification. Now I want to use the default sound notification with:

builder.setSound(Uri sound) 

But where is the Uri to the default notification?

like image 265
StefMa Avatar asked Jun 30 '12 06:06

StefMa


2 Answers

try using RingtoneManager to get Default Notification Uri as:

Uri uri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);  builder.setSound(uri); 
like image 157
ρяσѕρєя K Avatar answered Sep 17 '22 11:09

ρяσѕρєя K


builder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI) works as well

like image 34
Fortega Avatar answered Sep 20 '22 11:09

Fortega