Android查询联系人


1String [ ] projection

		public static final String[] PERSONAL_CONTACTS_SUMMARY_PROJECTION = new String[] {
				ContactsContract.Contacts._ID, // 0
				ContactsContract.Contacts.DISPLAY_NAME, // 1
				ContactsContract.Contacts.STARRED, // 2
				ContactsContract.Contacts.HAS_PHONE_NUMBER, // 3
				ContactsContract.Contacts.PHOTO_ID, // 4
				ContactsContract.Contacts.LOOKUP_KEY, // 5
				CONTACTS_SORT_KEY
		};

2 Uri


Uri uri=ContactsContract.Contacts.CONTENT_URI;




4

private static final int QUERY_TOKEN = 303;

private static final String SORT_KEY_ORDER = "sort_key COLLATE LOCALIZED ASC";

  5

		new AsyncQueryHandler().startQuery(QUERY_TOKEN, null, uri, 
				PERSONAL_CONTACTS_SUMMARY_PROJECTION, 
				null, 
				null, 
				SORT_KEY_ORDER);

你可能感兴趣的:(Android查询联系人)