Skip to content

Instantly share code, notes, and snippets.

@walteranyika
Created December 8, 2015 09:33
Show Gist options
  • Save walteranyika/589d9c3ea28c283b0328 to your computer and use it in GitHub Desktop.
Save walteranyika/589d9c3ea28c283b0328 to your computer and use it in GitHub Desktop.
Receive SMS Code
final Bundle bundle = intent.getExtras();
try {
if (bundle != null)
{
final Object[] pdusObj = (Object[]) bundle.get("pdus");
for (int i = 0; i < pdusObj.length; i++)
{
SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[i]);
} // end for loop
} // bundle is null
} catch (Exception e) {
Log.e("SmsReceiver", "Exception smsReceiver" +e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment