When developing a text message application, you sometimes need to intercept text message broadcasts to prevent text message broadcasts from being sent to other programs. To avoid multiple prompts, there are several key points to intercept text messages:
1. android receives text messages in broadcast mode.
2. You only need to add the "receive" SMS permission to your Manifest. xml file.
<Uses-permission android: name = "android. permission. RECEIVE_SMS"/>
3. Write a broadcast receiving class.
4. Add intent-filter to the receiver tag of Manifest. xml.
<Cycler android: name = ". Cycler">
<Intent-filter android: priority = "1000">
<Action android: name = "android. provider. Telephony. SMS_RECEIVED"/>
</Intent-filter>
</Cycler>
5. Use abortBroadcast (); to end the broadcast, so as to prevent the broadcast from being sent to other programs.
From Android Archives