[英]How to implement Android Notification with overview like WhatsApp?
我想在使用類似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);
但是在那種情況下,我沒有概述。 我在通知欄中只有一個小圖標:
最后,大約是一個優先級 :
notificationBuilder.setPriority(Notification.PRIORITY_HIGH);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.