I have written the function to notify and display at Notification bar:
private void showNotification()
{
CharSequence title = "Hello";
CharSequence message = "Notification Demo";
NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon, "A Notification", System.currentTimeMillis());
Intent notificationIntent = new Intent(this, Main_Activity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(Main_Activity.this, title, message, pendingIntent);
notificationManager.notify(NOTIFICATION_ID, notification);
}
Its working fine, But what way we can keep the notification steady at Notification bar
even when user press the "clear" notificatios button from the notification bar ?
Please have a look at the "Yahoo" application's notification bar.
I have gone through this SDK article: http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating , but failed to find out.