Is BroadcastReceiver.onReceive called exactly once per SMS?

I have a BroadcastReceiver listening for android.provider.Telephony.SMS_RECEIVED. I am going to intercept some SMS, so I will abortBroadcast (), but not for all SMS.

But when I retrieve SMS from intent, I think I can get MORE than one SMS?

Object[] messages = (Object[]) intent.getSerializableExtra("pdus"); 

Messages is Object [], does this mean that it can be several SMS? or I can safely assume that it will always be one SMS.

My problem is that if I receive several SMS messages and I need to intercept only one, I canโ€™t just work correctly, because if I turn off Broadcast (), the user will lose some legitimate SMS messages, and if not, he will receive SMS he should not.

I'm on Android 2.2

+4
source share
1 answer

I have not tried this myself, but according to the links below the rule "once per sms" is incorrect. In particular, onReceive is called with a .length> 1 message in the case of multi-page messages.

I think these links would be helpful:

+1
source

All Articles