Hi all,
I'm working with a module that receive sms and have a problem with
large sms(more than 160 chars).
The sms messages are received by a class extends
BroadcastReceiver.Below is the "onReceive" function
public void onReceive(Context context, Intent intent) {
if(!intent.getAction().equals(ACTION))
return;
SmsMessage[] messages = getMessagesFromIntent(intent);
if(null == messages)
return;
try {
for (int i = 0; i < messages.length; i++) {
SmsCallback callback = new
SmsCallback(SmsCallback.SMS_ACTION);
if(callback != null) {
callback.number =
messages[i].getDisplayOriginatingAddress();
callback.body =
messages[i].getDisplayMessageBody();
callback.timestamp =
messages[i].getTimestampMillis();
mainActivity.dispatcher.execute(callback);
}
}
}
catch(Exception e) {
}
}
//dispatcher is declare in "mainActivity.java": Executor dispatcher =
Executors.newSingleThreadExecutor();
with the normal sms, everything is ok. But with the large sms(ie: sms
is divided into 2 parts). the "callback" of this sms is not called
with part#1(messages[0]).But It's called with part#2(message[1]). So
the body message is not match.
Please help me, thanks.
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting