How to set notification with custom sound in android

notification.sound = Uri.parse("android.resource://" + getPackageName() + "https://stackoverflow.com/" + R.raw.notifysnd);
notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;

if defined DEFAULT_SOUND, then the default sound overrides any sound

Leave a Comment