Android: 显示所有按收藏夹排序的联系人
Android: Show all contacts sorted by favorites
我知道如何获取所有联系人以及如何获取收藏的联系人。
有没有办法将两者结合起来并按收藏夹排序?
getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "starred=?", new String[] {"1"}, <sort by favorites?>);
尝试使用此查询获取所有联系人的收藏夹顺序,然后按显示名称排序。
getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
null,
null,
ContactsContract.Contacts.STARRED + " DESC, " + ContactsContract.Contacts.DISPLAY_NAME_PRIMARY + " ASC");
我知道如何获取所有联系人以及如何获取收藏的联系人。 有没有办法将两者结合起来并按收藏夹排序?
getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "starred=?", new String[] {"1"}, <sort by favorites?>);
尝试使用此查询获取所有联系人的收藏夹顺序,然后按显示名称排序。
getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
null,
null,
ContactsContract.Contacts.STARRED + " DESC, " + ContactsContract.Contacts.DISPLAY_NAME_PRIMARY + " ASC");