Notification notifyUnit = mBuilder.build(); notifyUnit.defaults |= Notification.DEFAULT_SOUND; notifyUnit.flags |= Notification.FLAG_AUTO_CANCEL; notifyUnit.priority = Integer.MAX_VALUE; notifyUnit.flags |= Notification.FLAG_HIGH_PRIORITY; notifyUnit.tickerText = message.title; if(notifyUnit.contentIntent==null){ notifyUnit.contentIntent = pendingIntent; } // int notifyId =pushMessage.limitFlag==0?MoboPushNotifyHelper.NOTIFY_ID_NORMAL:pushMessage.type; // if(pushMessage.showAnyway){ // notifyId = new Random().nextInt(500); // } int notifyId =getNotifyId(message); getNotificationManager().notify(notifyId, notifyUnit);
notification flagjava
FLAG_SHOW_LIGHTS //LED閃dom
FLAG_ONGOING_EVENT////將此通知放到通知欄的"Ongoing"即"正在運行"組中ui
FLAG_INSISTENT// //重複發出聲音,直到用戶響應此通知spa
FLAG_ONLY_ALERT_ONCE//聲音 震動 等只發生一次blog
FLAG_AUTO_CANCEL////在通知欄上點擊此通知後自動清除此通知進程
FLAG_NO_CLEAR//代表在點擊了通知欄中的"清除通知"後,此通知不清除,get
FLAG_FOREGROUND_SERVICE//設置前臺進程只用於Service startForeground(int id, Notification notification)it
FLAG_HIGH_PRIORITY//高優先級io