この問題の解決方法が見つかりました。 FLAG_ONGOING_EVENTを使用して、通知を持続させました。ここでは、コードです:あなたがNotification.builderを使用する必要がありますし、あなたの使って2.Xと下位API場合は、NotificationComacpt.Builderを使用する必要があり、これが適用されないと私はcouldnよう
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.mypic;
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
notification.flags = Notification.FLAG_ONGOING_EVENT;
Context context = getApplicationContext();
CharSequence contentTitle = "Title Text";
CharSequence contentText = "Content text.";
Intent intent = new Intent(this, MyClass.class);
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
final int HELLO_ID = 1;
mNotificationManager.notify(HELLO_ID, notification);
'FLAG_ONGOING_EVENT'を使用する代わりに、通知を表示する場所に応じて' FLAG_NO_CLEAR'を使用することもできます(詳細はこちら)(http://developer.android.com/reference/android/app /Notification.html#FLAG_NO_CLEAR)) – THelper