满足以下条件时,通知会粘贴在通知栏上,无法通过水平滑动来消除:
service.stopForeground(Service.STOP_FOREGROUND_DETACH)
后立即致电service.startForeground(NOTIFICATION_ID, notification);
代码示例:
service.startForeground(NOTIFICATION_ID, notification);
service.stopForeground(Service.STOP_FOREGROUND_DETACH);
即使在startForeground
之后立即调用前台服务,我是否可以做些强制停止前台服务的操作?