【发布时间】:2017-11-10 03:59:57
【问题描述】:
我对来电使用全屏通知并通过以下方式播放铃声:
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setSmallIcon(smallIcon)
.setContentIntent(contentIntent)
.setContentTitle(title)
.setContentText(text)
.setVibrate(vibratePattern)
.setSound(RingToneUtils.getDefaultRingtoneURI(), AudioManager.STREAM_RING)
.setAutoCancel(false)
.setLights(Color.argb(255, 0, 0, 255), 300, 300)
.addAction(iconAction1, action1, answerActionPendingIntent)
.addAction(iconAction2, action2, rejectActionPendingIntent)
.setFullScreenIntent(contentIntent, true);
这可以正常工作,并在适当时显示为 HUD。问题是铃声音量是由通知音量流而不是铃声音量流控制的。
如何将这修正为铃声流?从技术上讲,这是一个通知,但对用户来说这似乎是错误的。
【问题讨论】:
-
您是否正在寻找类似播放铃声的通知?
-
不,它会播放铃声,正如您在 .setSound() 行中看到的那样。我想用铃声而不是通知音量来控制音量,因为它是铃声而不是通知音
标签: android notifications volume