常驻通知栏
public void setFLAG_NO_CLEAR_Notification() {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
long when = System.currentTimeMillis();
Notification notification = new Notification.Builder(application).setSmallIcon(R.drawable.poly_mdm)
.setContentTitle("").setContentText("安全锁已打开").setTicker("").setWhen(when)
.setAutoCancel(true).setDefaults(Notification.DEFAULT_SOUND)
.setContentIntent(null).build();
//<span style="color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 22.1px;">使得服务能挂在通知栏</span>
notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
notificationManager.notify(0x100, notification);
}