If you wonder why even after calling setAutoCancel(true) after you instantiate Notification.Builder and tapping on the notification it still stays put in the notification area, you did nothing wrong.
You just lacked something for sure. The thing is, you have to set an Intent so that when you tap on the notification, it will execute that Intent. The setAutoCancel(true) will then work and hide the notification.
Here is a sample code that will just hide the notification and does nothing else.
Okay, so there may be times wherein you do not want to pass an Intent to redirect users to an app whenever the user may tap on the notification. The quickest thing that I thought might work was to pass a null Intent to the Notification object.
However, this is wrong as it can lead to problems. The correct way is to do it like this