I recently added a notification feature for my widget and what I wanted was whenever the user clicks or taps the notification message in the notification center, it will remove itself rather than having to click the clear all button.
The secret lies in the flags of the Notification class by using Notification.FLAG_AUTO_CANCEL. However, to ensure that this works, the code has to be bitwise-or the flags like this
Notification notification = new Notification(R.drawable.icon, "Title", "This is a message", System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Pretty easy, right?