4

I have a BroadcastReceiver listenting 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 extract the SMS from the intent, I guess I can get MORE than one SMS?

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

messages is an Object[], does it mean it could be several SMS? or I can safely assume it will always be one SMS.

My problem is that if I receive several SMS and I need to intercept only one, I cannot just operate correctly, cause if I abortBroadcast() the user will loose some legit SMS and if I don't he will get some SMS he should not.

I am on Android 2.2

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
Persimmonium
  • 15,593
  • 11
  • 47
  • 78

1 Answers1

1

I have not tried it myself but according to the links below "once per sms" rule is not correct. Particularly, onReceive is called with messages.length > 1 in the case of multipart messages.

I think these links would be helpful:

Community
  • 1
  • 1
brighteyed
  • 146
  • 3
  • 6