String strOrder = ContactsContract.Contacts.DISPLAY_NAME;
String SELECTION = ContactsContract.Contacts.HAS_PHONE_NUMBER+ "='1'";
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
Uri.encode(Your Phone Number);
Cursor objCursor = getContentResolver().query(uri,new String[] { PhoneLookup.DISPLAY_NAME },
SELECTION, null, strOrder);
if (objCursor.getCount() > 0)
{
objCursor.moveToPosition(-1);
while (objCursor.moveToNext())
{
System.out.Println(objCursor.getString(objCursor.getColumnIndex(
ContactsContract.Contacts.DISPLAY_NAME)));
}
}
objCursor.close();
No comments:
Post a Comment