如果要这样使用Notification.PRIORITY_HIGH:
您必须更改Notification.PRIORITY_HIGH优先级或Notification.PRIORITY_MAX重要性。
通知优先级,由Notification.PRIORITY_HIGH设置。该优先级确定该通知在Android 7.1及更低版本上的介入程度。 (对于Android 8.0及更高版本,您必须改为设置频道重要性)
在Android 7.1(API级别25)及更低版本上:
将通知优先级设置为Notification.PRIORITY_HIGH或Notification.PRIORITY_MAX。
设置铃声和振动-您可以使用Notification.PRIORITY_HIGH
Android 8.0(API级别26)及更高版本:
将通知渠道优先级设置为Notification.PRIORITY_HIGH
通知:
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.drawable.ic_wald_poi)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_poi))
.setColor(getResources().getColor(R.color.primary))
.setContentTitle(getString(R.string.hello))
.se