android - Update notification to remove chronometer (KitKat) -


i need show notification , update on course of lifetime. in particular, need change flags, such "show chronometer". that, documentation states should call notificationmanager.notify() same id.

so idea have these methods:

private void showinitialnotification() {     notificationcompat.builder builder = new notificationcompat.builder(this);     ...     mnotificationmanager.notify(notification_id, builder.build()); }  private void addchronometerflag() {     notificationcompat.builder builder = new notificationcompat.builder(this);     ...     builder.setuseschronometer(true);     mnotificationmanager.notify(notification_id, builder.build()); }  private void removechronometerflag() {     notificationcompat.builder builder = new notificationcompat.builder(this);     ...     builder.setuseschronometer(false);     mnotificationmanager.notify(notification_id, builder.build()); } 

this works ok in android 5.1 , 6.0, in android 4.4 (and below, guess?) the chronometer not removed, although content title, text, icon &c updated correctly.

any idea why?

i cannot use same notification.builder object (for example suggested in this answer) since need update actions available on notification , there no way remove added actions builder.

my use case more complicated (it's media player) minimum example of bug i've been able reproduce. it's present, example, in google's universalmusicplayer sample -- works fine in lollipop, not in kitkat.

fwiw, full example code here.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -