我希望在设备使用时像概述 实施通知,例如WhatsApp:
我通过这种方式了解基本实现:
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), 0);
Notification notification = new Notification.Builder(this)
.setContentTitle("Title")
.setContentText("Message")
.setSmallIcon(R.drawable.ic_notif)
.setContentIntent(mPendingIntent)
.build();
NotificationManager notificationManager =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(1, notification);
但在那种情况下,我没有概述。我在通知栏中只有一个小图标:
答案 0 :(得分:1)
最后,它只是优先级:
notificationBuilder.setPriority(Notification.PRIORITY_HIGH);