我想通过自定义声音环在Android中连续添加警报通知。当我添加默认声音时,可以连续响铃,但如果添加自定义声音,则只能响铃一次。
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setColor(ContextCompat.getColor(context, R.color.colorAccent))
.setContentTitle(context.getString(R.string.app_name))
.setContentText(alarm.getLabel())
.setTicker(alarm.getLabel())
.setSound(uri)
.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE)
.setContentIntent(pIntent)
.setPriority(Notification.PRIORITY_HIGH);
manager.notify(id, builder.build());