我已经开发了一段时间的Android,但这是我第一次尝试通知。我按照Android SDK教程中描述的方法设置了我的通知,但我不知道如何保持通知显示直到我的应用程序关闭。我想禁用通知末尾的小减号标志。我不希望用户单击通知后通知消失。我认为会有一个通知标志...但我似乎无法弄清楚这个问题。我正在开发Android SDK 2.2。我知道这是一个简单的问题,如果这个答案已经在这里了,我很抱歉...我没有找到我要找的东西。
// Create notification manager
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
Notification notification = new Notification(R.drawable.ic_launcher, "Ready", System.currentTimeMillis());
Intent notificationIntent = new Intent(this, HomeActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
// Make a notification
notification.setLatestEventInfo(getApplicationContext(), "Ready", "Select to manage your settings", contentIntent);
mNotificationManager.notify(0, notification);