MY 应用程序在运行时显示通知。但是当我单击主页按钮(应用程序仍在后台运行)时,通知消失了。在用户点击它之前,我应该怎么做才能保持原样。谢谢
private void showNotification() {
// The PendingIntent to launch our activity if the user selects this
// notification
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
serviceIntent, 0);
Notification notification = new Notification.Builder(this)
.setTicker("Accelormeter app").setContentTitle("Acc")
.setContentText("Notification content.")
.setSmallIcon(R.drawable.noti_icon).setContentIntent(contentIntent)
.getNotification();
// Send the notification.
mNM.notify(0, notification);
}