There is a receiver of broadcast intentions, which in some case sends a Notification (when clicking on it), we open a window, more precisely, we call a new Intent. The question is how to make the notification disappear from the bar status when clicking on it / opening a new intent. Ps I just know how to remove it, but I need it exactly when we clicked on it and moved to a new intent.

    1 answer 1

    In Notification during creation you need to set the corresponding flag, FLAG_AUTO_CANCEL . Then when you click on the notification, it will automatically disappear.

    Like that:

     notification.flags |= Notification.FLAG_AUTO_CANCEL