I want to marks a sms as read . I have id of that sms . I have tried the following code to mark this sms as read .
public void setRead(int position, String smsMessageId) {
ContentValues values = new ContentValues();
values.put("read",true);
int flag = context.getContentResolver().update(Uri.parse("content://sms/inbox"),
values, "_id=" + smsMessageId, null);
Toast.makeText(context, "The result is "+flag, Toast.LENGTH_LONG).show();
}
But the return result is 0 . Why is the return result 0 ?