Reputation: 1783
From the SMS content provider I was able to extract a list of contacts with whom I have messaged (as in the native messaging app). Right now, if I select one of the contacts, all the SMS inbox and outbox is shown. How can I show only the messages from the selected contact?
Upvotes: 0
Views: 63
Reputation: 132982
try this :
String[] smsNo={"YOUR_NUMBER"};
Cursor cursor = contentResolver.query(
Uri.parse("content://sms"), null,"address=?", smsNo, null);
if (cursor.moveToFirst()) {
int index_Body = cursor.getColumnIndex("body");
do {
String strbody = cursor.getString(index_Body);
} while (cursor.moveToNext());
}
Upvotes: 1