このコードを使用しています:
protected String getContactInfo() {
Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, null, null, null);
String str = "";
while (cursor.moveToNext()) {
str += cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)) + ", ";
}
cursor.close();
return str;
}
実行後、このメソッドが返す文字列は、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test1、Test2、Test2、Test2、Test2、Test2、Bob、ボブ、ボブ、ボブ、
電話帳に Test1、Test2、Bob の連絡先が 3 つしかない場合
なぜこれが起こるのでしょうか?