Android - Keep notification steady at Notification Bar -


I wrote a function to inform and display in the Notification Bar:

  Personal Notice to show zero () Title = "Hello"; Charity Message = "Notification Demo"; Information Manager Information Manager = (Notification Manager) getSystemService (NOTIFICATION_SERVICE); Notification Notification = New Notification (Ardoable.con, "A Notification", System Syrtetime Millis ()); Intent notification = new intent (this, men_activity.class); Pending pending vertical anticipated = pending entity.get activity (this, 0, notification notice, 0); Notification.SetLatestEventInfo (Main_activityThis, title, message, pending); Information Manager Information (Notification_ID, Notification); }   

Its work is fine, but how can we keep the information stable in information bar , even if the user is "clear" "Notification button from notification bar?

Please take a look at the notification bar of the "Yahoo" application.

Enter the image details here

I have written this SDK article Have gone through: but failed to find out.

Use FLAG_NO_CLEAR

Just do it yourself Set up Notification before supplying it Notification Manager :

  notificaton.flags | = Notice FLAG_NO_CLEAR; Edit:  I have just seen that if you are using  notification. Builder /  (since Honeycomb) And the notification "on" will also become immune to this "cleanse all".  

Obviously, this is considered to discourage developers from using FLAG_NO_CLEAR without any current notifications because it can mislead the user.

Comments