我嘗試一個通知示例。如何添加Android Notificaton其他說明?
如何添加額外的指令這樣的形象
我的通知代碼
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setContentTitle("New Message with implicit intent")
.setContentText("New message from javacodegeeks received...")
.setTicker("Implicit: New Message Received!")
.setSmallIcon(MainActivity.NotiImage)
.setAutoCancel(false)
.setNumber(++NotificationHelper.messagges)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), MainActivity.NotiImage));
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
String[] events = new String[3];
events[0] = new String("1) Message for implicit intent");
events[1] = new String("2) big view Notification");
events[2] = new String("3) from javacodegeeks!");
inboxStyle.setBigContentTitle("More Details:");
for (int i=0; i < 9; i++) {
inboxStyle.addLine("olkun " + i);
}
mBuilder.setStyle(inboxStyle);
NotificationManager myNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
myNotificationManager.notify(1, mBuilder.build());
是你想要的更新。 İt's爲我工作。謝謝 –