Notifications 如何删除android前台服务通知开始时的持续时间?

Notifications 如何删除android前台服务通知开始时的持续时间?,notifications,foreground-service,android-8.1-oreo,Notifications,Foreground Service,Android 8.1 Oreo,setWhen(0)使通知中的持续时间为空 NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.notification_icon) .setContentTitle("My notification") .setContentText("Hello World!") .setContentIntent(pendingIntent) .setWhen

setWhen(0)使通知中的持续时间为空

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My notification")
.setContentText("Hello World!")
.setContentIntent(pendingIntent)
.setWhen(0);