androidnotifications

Android ongoing notification is cancellable


I'm trying to create a notification that should not be cancellable (used in a foreground service), yet the users can swipe it away(Tested on Android 14). Here is what I've used:

        .setOngoing(true)
        .setAutoCancel(false)

Am I missing something here?


Solution

  • Am I missing something here?

    No, insofar as what you describe is documented and expected behavior.