I am using the following to get the SMS from inbox
ContentResolver cr = getContentResolver();
Cursor cur = cr.query(Uri.parse("content://sms"), null,null,null, null);
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
cursor_count=cur.getCount();
if(cur.moveToFirst())
{
do {
sender.add(cur.getString(2));
msg.add(cur.getString(11));
date.add(formatter.format(Long.parseLong(cur.getString(4))));
} while (cur.moveToNext());
I get the address of the person from the address field, but I also want to get the contact name of the sender, if stored in my contacts.
The person field always returns null, why?
try this code