2012-06-10 5 views
2

이렇게 Android에서 Google 계정의 RawContacts를 읽는 중입니다.RawContacts를 읽는 동안 GooglePlus 연락처를 제외하는 방법

final Cursor cursor = cr.query(
    ContactsContract.RawContacts.CONTENT_URI, null, 
    RawContacts.ACCOUNT_TYPE + " = ?", 
    new String[] { "com.google" }, "display_name"); 
Log.i(TAG, "Start RawContact table"); 
for (int i = 0; i < cursor.getColumnCount(); i++) { 
    Log.d(TAG, i + " : " + cursor.getColumnName(i) + " : " 
      + cursor.getString(i) + "\n"); 
} 
Log.i(TAG, "End RawContact table"); 

그러나 Google 플러스 연락처 또한 믹스에 포함됩니다.

06-10 15:05:11.139: D/Merger(20004): 13 : account_type : com.google 
06-10 15:05:11.139: D/Merger(20004): 14 : account_type_and_data_set : com.google/plus 

어떻게 방지 할 수 있습니까?

답변

1

답변은 매우 간단합니다. 나는 단지 그것을 보지 못했다. 희망이 사람을 도움이됩니다.

Cursor cursor = cr.query(
      ContactsContract.RawContacts.CONTENT_URI, null, 
      RawContacts.ACCOUNT_TYPE + " IS ? AND "+ RawContacts.DATA_SET+" IS NULL", 
      new String[] { "com.google", }, "display_name"); 
관련 문제