Skip to content Skip to sidebar Skip to footer

How To Disable A Click Event Of Notification In Android Development

as we know , we can append pendingintent to the notification so if we click the notification we can run the intent , start a activity ,service or broadcast so if I want to dis

Solution 1:

Use Intent intent = new Intent() and insert this into the PendingIntent.

Solution 2:

This is not direct answer, but you shouldn't disable click on notification. This will result in poor user experience, as user will not be able to navigate to your application and/or cancel what you're doing. This may frustrate user, as he or she may not even know what application is the source of this notification and won't be able to easily understand how to remove this notification (if its ongoing).

Solution 3:

As per CommonsWare's answer to my duplicate question, this is not possible. The notification manager is part of the firmware, and we cannot control that part of its behaviour.

see: Android Notification without click event?

Solution 4:

Check this answer. I think you should use setAutoCancel(false) method from NotificationCompat.Builder.

Post a Comment for "How To Disable A Click Event Of Notification In Android Development"