Once encountered such a problem, in my code to use the notification bar, everything is normal, but is in the notification bar in progress of my program is always jumping up and down, a flash. Feel the user experience is very bad, so Google, found a solution.
In my code, that's what I wrote.
Copy Code code as follows:
Notification.when = System.currenttimemillis ();
This is the crux of the problem, and for notifications, when this attribute value should be fixed at the start of an activity. If it is not fixed, the default value is used, and the default value is the current time, which is the value of System.currenttimemillis (). So using a custom fixed value can solve the problem.
Copy Code code as follows:
Final long timestamp_fixed = 1234567890l;
Notification.when = timestamp_fixed;
Here's how Google describes how to use the notification when.
Copy Code code as follows:
A timestamp related to that notification, in milliseconds since the epoch. Default Value:now. Choose a timestamp that would be most relevant to the user. For most finite events, this is corresponds to the "time" of the event happened (or would happen, in the case of events that have Y ET to occur but about which the user is being informed). Indefinite events should be timestamped according to when the activity began. Some Examples:
Notification of a new chat message should is stamped when the message was received.
Notification of ongoing file download (with a progress bar, for example) should is stamped when the download.
Notification of a completed file download should is stamped when the download finished.
Notification of a upcoming meeting should being stamped with the "time" of the meeting would begin (that's, in the future).
Notification of an ongoing stopwatch (increasing timer) should is stamped with the watch ' s start time.
Notification of an ongoing countdown timer should is stamped with the timer ' s.
Reference
Http://developer.android.com/reference/android/app/Notification.html