I used to use content resolver previously to fetch Contact list and their details while that still works I wanted to try the Loader method which queries the Content Provider
This is an excerpt of what I actually do in my (working) code.
These are my relevant imports:
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
Given that id is a string (representing a number, like "1", "20", ...)
// Query for phone numbers for the selected contact id
final Cursor cur = getContentResolver().query
(
Phone.CONTENT_URI, null,
Phone.CONTACT_ID + "=?",
new String[] {id}, null
);
final int phoneIdx = cur.getColumnIndex(Phone.NUMBER);
final int phoneType = cur.getColumnIndex(Phone.TYPE);
// ...
if(cur.moveToFirst())
{
final String name =
cur.getString
(
cur.getColumnIndexOrThrow
(
ContactsContract.Contacts.DISPLAY_NAME
)
);
}
Hope it puts you on the right path