Notification button not work with some Android devices -


i have weird problem. implemented notification action buttons, works on adroid 5.0, not on android 4.2 or higher (whathever 4.0 android). can see buttons, can click on buttons, nothing happens. global notification intent working fine on both version, action buttons not :/ can give me advise how possible ??

here's code:

 public int onstartcommand(intent intent, int flags, int startid) {     switch (intent.getaction()) {         case serviceutils.action_service_start_foreground:             ...             if (object != null) {                 buildnotification();                 ...             }             break;         case serviceutils.action_service_pause_foreground:             ...             if (object != null) {                 ...                 buildnotification();             }             break;         case serviceutils.action_service_stop_foreground:             // stop service             ...             stopforeground(true);             stopself();              // dismiss notification bar             notificationmanager notificationmanager = (notificationmanager) this.getsystemservice(context.notification_service);             notificationmanager.cancel(...);             break;     }     return start_sticky; }  private void buildnotification() {     notificationcompat.builder notification = new notificationcompat.builder(this)             .setcontenttitle(...)             .setticker(getstring(r.string.service_begin))             .setcontenttext(...)             .setsmallicon(r.drawable.ic_menu_join)             .setlargeicon(bitmap.createscaledbitmap(bitmapfactory.decoderesource(getresources(), r.drawable.ic_menu_join), 128, 128, false))             .setcontentintent(getnotificationintent())             .setongoing(true)             .addaction(android.r.drawable.ic_menu_close_clear_cancel, getstring(r.string.service_notification_stop), getstopintent());      if (condition) {         notification.addaction(android.r.drawable.ic_media_pause, getstring(r.string.service_notification_pause), getpauseintent());     }      startforeground(..._foreground_service, notification.build()); }  // intents private pendingintent getstopintent() {     intent stopintent = new intent(this, foregroundservice.class);     stopintent.setaction(serviceutils.action_service_stop_foreground);     stopintent.putextra(..., ...);     return pendingintent.getservice(this, 0, stopintent, pendingintent.flag_update_current); }  private pendingintent getpauseintent() {     intent pauseintent = new intent(this, foregroundservice.class);     pauseintent.setaction(serviceutils.action_service_pause_foreground);     pauseintent.putextra(..., ...);     pauseintent.putextra(..., ...);     return pendingintent.getservice(this, 0, pauseintent, pendingintent.flag_update_current); }  private pendingintent getnotificationintent() {     intent notificationintent;     if (condition) {         notificationintent = new intent(this, ...class);     } else {         notificationintent = new intent(this, ...class);     }      notificationintent.putextra(..., ...);     return pendingintent.getactivity(this, 0, notificationintent, pendingintent.flag_update_current); } 

problem android 4.0 after clicking on notification buttons, nothing happens, neither start "intent" ?? had logs there , nothing ... :/ on devices working, on not


Comments