-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
(1) Problem:
In Chapter8 SMSNotifExample, "messages" is allocated
but not set to pdusObj.
(2) Source snip showing problem:
From SMSNotifyExample.java (with my comment)
if (bundle != null) {
Object[] pdusObj = (Object[]) bundle.get("pdus");
SmsMessage[] messages = new SmsMessage[pdusObj.length];
for (SmsMessage currentMessage : messages) {
sb.append("Received compressed SMS\nFrom: ");
//Note: currentMessage not set
sb.append(currentMessage.getDisplayOriginatingAddress());
....
}
}
(3) Solution:
SmsMessage.createFromPdu need to be called before sb.append :
currentMessage = SmsMessage.createFromPdu(
(byte[]) pdusObj[index]);
Original issue reported on code.google.com by az9...@gmail.com on 23 Jun 2009 at 6:42