Android programming method for intercepting short messages and shielding system notification
This paper describes the method of intercepting short messages and shielding system notification by Android programming. Share with you for your reference, as follows:
There are several key points for intercepting SMS:
1. Android receives SMS by broadcasting
2. As long as the program has the permission to "receive" SMS in its manifest.xml
3. Write a broadcast receiving class
4. In the receiver tag of manifest.xml, an intent filter should be added, and the action is
5. It is important to add priority to this intent filter so that the SMS received by you takes precedence over the system or other software
6. When your program receives the SMS to be blocked, use this. Abortbroadcast(); To end the broadcast, continue to send it to other programs, so that the system will not receive SMS broadcast and notification will not be prompted
The source code is as follows:
Manifest.xml
Broadcastreceiver class:
I hope this article will help you in Android programming.