How to cancel a foreground service from using the notification (swipe dismiss) or clear all notifications?
问题 I'm currently creating a foreground service with a notification that appears in the notification bar when the service starts. If the service stops, the notification dismisses. My question is, is there a way to stop the service when "clear all notifications" or a dismiss of the notification (swipe) occurs? Updated to include implementation of notification: public int onStartCommand(Intent intent, int flags, int startId) { Log.d(CLASS, "onStartCommand service started."); if (getString(R.string