Set sms as read in Android

后端 未结 2 1884
情话喂你
情话喂你 2020-12-11 19:28

In my application I need to read sms coming from only a number, and when i receive it I need to set it as read automatically, without setting it in the sms android applicati

2条回答
  •  天涯浪人
    2020-12-11 20:10

    Let me update this:

    ContentValues values = new ContentValues();
    values.put("read",true);
    getContentResolver().update(Uri.parse("content://sms/"),values, "_id="+SmsMessageId, null);
    

    SmsMessageId is _id of message, which you find in SMS database.

提交回复
热议问题