如何获取传入短信的时间戳。这是我的代码。
public void onReceive(Context context, Intent intent) {
Log.i("SMS Reciever", "smsReceiver: SMS Received");
Bundle bundle = intent.getExtras();
if (bundle != null) {
Log.i("SMS Reciever", "smsReceiver : Reading Bundle");
Object[] pdus = (Object[])bundle.get("pdus");
for (int i = 0; i < pdus.length; i++) {
SmsMessage sms = SmsMessage.createFromPdu((byte[])pdus[i]);
SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdus[i]);
String phoneNumber = currentMessage.getDisplayOriginatingAddress();
String senderNum = phoneNumber;
String message = currentMessage.getDisplayMessageBody();
Log.i("SmsReceiver", "Send From: "+ senderNum + "; message: " + message);