Search code examples
androidsmssmsmanager

Android: is there a way to receive the sms message from both SMSManager and the SMS receiver


Is there a way to receive the SMS message from both SMS Manager (default SMS application on android) and the SMS receiver.

I was trying to change priority and I can make any of these to get the SMS separately, but I don't know if it is possible to make them both to get the message.


Solution

  • Unless you set your receiver to a priority higher than the default SMS app and call abortBroadcast() in your receiver, then the broadcast will continue down the priority list, and every app registered to receive the android.provider.Telephony.SMS_RECEIVED broadcast will get it (unless one of those apps aborts the broadcast).

    You shouldn't be aborting a android.provider.Telephony.SMS_RECEIVED broadcast unless you've determined that the message is for only your app.