我创建推送通知。当我在Android 9上使用手机时发生了问题,滑动时通知是静态的,无法清除。这是我的通知生成器。
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(icono)
.setColor(getResources().getColor(R.color.colorAccent1))
.setVibrate(new long[]{2000, 2000, 2000, 2000, 2000})
.setLights(Color.RED, 3000, 3000)
.setContentTitle(Ititle)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText(iBody)
.setAutoCancel(true)
.setOngoing(false)
.setSound(soundUri)
.setContentIntent(pendingIntent);