我正在将新的HeadsUp通知添加到我的Android应用中,以显示为来电,将响30或40秒。默认的HeadsUp通知只会响10秒然后停止。我搜索了一会儿找到让通知响30或40秒的方法。似乎没有任何东西可以让我控制通知响铃持续时间。
回答我的问题 这是我更新的通知初始化代码,以回答我的问题:
var $temp = $("<input>");
$("body").append($temp);
$temp.val($( this ).attr('name')).select();
document.execCommand("copy");
$temp.remove();
所以主要是解决方案是将通知类别设置为 Notification.CATEGORY_CALL