I have fetched all message from a particular number from inbox by the following code .
public void refreshSmsInbox() {
ContentResolver contentResolver = getContentResolver();
Cursor smsInboxCursor = contentResolver.query(
Uri.parse("content://sms/inbox"), null, null, null, null);
int indexBody = smsInboxCursor.getColumnIndex("body");
int indexAddress = smsInboxCursor.getColumnIndex("address");
if (indexBody < 0 || !smsInboxCursor.moveToFirst())
return;
arrayAdapter.clear();
do {
if (pre_address.equals(smsInboxCursor.getString(indexAddress))) {
String str = "SMS From: "
+ smsInboxCursor.getString(indexAddress) + "\n"
+ smsInboxCursor.getString(indexBody) + "\n";
arrayAdapter.add(str);
}
} while (smsInboxCursor.moveToNext());
}
Now I want to mark which sms are read and which are unread . How can I check which sms are read and which are unread ?
How can I check whether a sms is read or unread at the time of fetching from inbox ?