I am working with SMSReceiver and a dialog to display address, message and time of the SMS will be shown when a message arrives. I want to remove notification icon when a user clicks OK button in the custom dialog. Pleas let me know how I can do this.
Thanks in Advance.
It is not possible to directly remove the notification. This is because the notification is being generated by a different application (system Messaging app or a custom SMS app). Only the app which generates the notifications is able to remove them.
There is however something you can try to do.
You could consume the system broadcast for the incoming SMS instead of propagating it further which would mean that the other applications responsible for handling SMS messages would not be informed about a new message being delived.
In order to do that you should:
Increase the priority of your receiver:
Abort the broadcast in your
onReceive()implementation: