1
我正在使用以下查詢來獲取聯繫人列表。如何避免使用ContactContract.CommonDataKinds.Phone.CONTENT_URI從聯繫人數據庫重複的值?
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
String SELECTION = String.format("%s =\'1\' AND length(\"%s, \") > 0",
ContactsContract.Contacts.HAS_PHONE_NUMBER,
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY);
return new CursorLoader(context,
ContactsContract.CommonDataKinds.Phone.CONTENT_URI, // URI
ContactProfile.CONTACT_PROJECTION, // projection fields
SELECTION, // the selection criteria
null, // the selection args
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME_PRIMARY
+ " COLLATE NOCASE ASC" // case insensitive sort order
);
}
但我在手機與多個帳戶重複值。如何避免此重複值