Am using the below code
Object[] pdusObj = (Object[]) bundle.get("pdus");
SmsMessage[] messages = new SmsMessage[pdusObj.length];
But,somehow I get a null pointer in the second line basicaly due to the fact that pdusObj is null.I searched for resolving this but didnt get any positive results.Any link or explanation to resolve this will be very helpfull.
This is how am registering the service
Intent i = new Intent(context, SMSReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(context, 0, i, 0);
// We want the alarm to go off 3 seconds from now.
long firstTime = SystemClock.elapsedRealtime();
firstTime += 2000;// start 3 seconds after first register.
// Schedule the alarm!
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,300000, sender);// 5 min interval