如何在Android的onReceive上获取SMS ID?以后使用该smsId,我想更新该短信的文本,这怎么可能?

时间:2018-06-28 17:05:18

标签: java android sms

这是我在Java中保存短信的方式

private void saveSmsInInbox(Context context, SmsMessage sms) {
    Intent serviceIntent = new Intent(context, SaveSmsService.class);
    serviceIntent.putExtra("sender_no", sms.getDisplayOriginatingAddress());
    serviceIntent.putExtra("message", sms.getDisplayMessageBody());
    serviceIntent.putExtra("date", sms.getTimestampMillis());
    context.startService(serviceIntent);
}

1 个答案:

答案 0 :(得分:0)

作为KitKat,只有默认的SMS应用程序可以写入SMS数据库。因此,除非您是用户选择的手机短信应用程序,否则以后将无法更新短信文本。