我正在处理一个项目,并且在通知中遇到了一个奇怪的问题。 基本上我想在通知中播放警报,为此我在通知生成器中添加声音eguri。 这里是我的代码:通知声音在打开通知面板时停止
builder.setSmallIcon(R.mipmap.app_icon).setContentTitle(title)
.setContentText(msg)
.setColor(getResources().getColor(R.color.white))
.addAction(R.drawable.alarm_off, getString(R.string.dismiss), pendingIntent)
.setOngoing(true)
.setSound(Uri.parse(path));
Notification notification = builder.build();
notification.flags |= Notification.FLAG_INSISTENT;
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(WAKE_UP_ALARM_ID, notification);
通知出现在面板,但是当我摸到通知面板向下滚动,音乐自动停止。 我无法理解这种情况。
请帮我解决问题。
感谢
是android系统 –
的默认行为,但是当警报在Android机器人扮演棒棒糖它的连续播放。 –
以及我不知道什么发生了警报,但我很确定警报不通知,即使在文档FLAG_INSISTENT在文档中,你会发现,当用户打开通知菜单的声音将停止 –