2011-03-16 104 views
0

對於給定的People._IDs列表,我如何獲取聯繫人電話號碼?獲取聯繫人的電話號碼Android 1.5

private void getCntctList(List<GroupMembers> mids){ 
    ArrayList<ContactItem> contact_list = new ArrayList<ContactItem>(); 
    ContentResolver cr = getContentResolver(); 
    String where = "People._ID IN ("; 
    for (GroupMembers g : mids) { 
     where += g.personId + ","; 
    } 
    where = where.substring(0,where.length()-1) + ")"; 
    Cursor contactCur = cr.query(????, null, where, null, null); 
    if (contactCur.getCount() > 0) { 
     while (contactCur.moveToNext()) { 

      ... 

     } 
    } 
} 
+0

你只想要主電話號碼或所有電話號碼? – 2011-03-16 01:26:06

回答

1

我假設你想要聯繫人的主要電話號碼?你的代碼是錯誤的。它應該是這樣的:

​​
+0

如果我能擁抱你,我會的。如果我只能看到這些當前數據庫模式的圖形描述,我會提前獲得金錢。感謝Nic。 – 2011-03-16 10:51:25

相關問題