AggregationSuggestions

来源:互联网 发布:沈阳软件行业 编辑:程序博客网 时间:2024/06/05 17:33
AggregationSuggestions
java.lang.Object
        android.provider.ContactsContract.Contacts.AggregationSuggestions
Class Overview
A read-only sub-directory of a single contact aggregate that contains all aggregation suggestions (other contacts).
The aggregation suggestions are computed based on approximate data matches with this contact.
Note: this query may be expensive! If you need to use it in bulk,
 make sure the user experience is acceptable when the query runs for a long time. 

 它能查询建议和contactId合成一组的Contacts集合。
 注意1:查询结果不包括其本身。
 注意2:该查询很耗时。
 注意3:这里查询返回的结果也是17列,和Contact一样。具体可以参照《Contact类
 例1:    
    Uri uri = Contacts.CONTENT_URI.buildUpon()
     .appendEncodedPath(String.valueOf(contactId))
     .appendPath(Contacts.AggregationSuggestions.CONTENT_DIRECTORY)
     .appendQueryParameter("limit", "3")//这里限定了返回的最大项数
     .build();
     Cursor c = context.getContentResolver().query(uri,
     new String[] {Contacts.DISPLAY_NAME, Contacts._ID, Contacts.LOOKUP_KEY},
     null, null, null);