Method 1:
Http://blog.csdn.net/xys289187120/article/details/6730957
Method 2:
// Traverse all phone numbers
Cursor phonecur = getcontentresolver (). Query (
Contactscontract. commondatakinds. Phone. content_uri,
Null,
Null,
Null, null );
Private void initcontactinfos (cursor phonecur ){
// Todo auto-generated method stub
If (phonecur = NULL) return;
Phonecur. Move (-1 );
While (phonecur. movetonext ()){
Contactinfo = new contactinfo ();
Contactinfo. personid = phonecur. getlong (phonecur. getcolumnindex (contactscontract. commondatakinds. Phone. contact_id ));
Contactinfo. Number = phonecur. getstring (phonecur. getcolumnindex (contactscontract. commondatakinds. Phone. Number ));
Contactinfo. Name = phonecur. getstring (phonecur. getcolumnindex (contactscontract. commondatakinds. Phone. display_name ));
If (contactinfo. Name = NULL ){
Contactinfo. Name = contactinfo. number;
}
Mcontactinfos. Add (contactinfo );
}
}