I have been developing for Android for a while, but this is my first shot in notifications. I have a notification setting, as described in the Android SDK tutorial, but I canβt figure out how to save the notification until my application is closed. I want to disable this little minus sign at the end of the notification. I do not want my notification to disappear when the user clicks on it. I think there will be a notification flag ... but I can't figure it out. I am developing an Android SDK 2.2. I know this is a simple question, and I apologize if this answer is already here ... I could not find exactly what I was looking for.
// 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);
source share