Set Read status in SMS
<p>I'm writing a quick application for SMS Popup. What I want to do is, once the user closes the popup, the SMS should automatically be set as read. But I don't find a way to do so. I thought of using the date column. But its not working, I mean the no. of updated rows is always 0
This is my code:</p>

<pre><code>public static int setMessageRead(Context context, long date, boolean isViewed){
    try
    {
        ContentValues contentValues = new ContentValues();
        if (isViewed){
            contentValues.put("read", 1);
            contentValues.put("seen", 1);
        }
        else
        {
            contentValues.put("read", 0);
        }

        Log.d("SMS Popup", "Date: " + date);

        int rows = context.getContentResolver().update(
                Uri.parse("content://sms"), 
                contentValues,
                "date=" + date, 
                null);
        return rows;
    }
    catch (Exception ex)
    {
        Log.d("SMS Popup", "Message Read Exception", ex);
        return -1;
    }
}
</code></pre>

<p>It always returns as 0. Date is in milliseconds as obtained by getTimestampMillis() method in my Broadcast receiver</p>
