Created
December 8, 2015 09:33
-
-
Save walteranyika/589d9c3ea28c283b0328 to your computer and use it in GitHub Desktop.
Receive SMS Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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