0
ContentResolver를 사용하여 계정 유형 (whatsapp, viber 등)을 검색하는 방법은 무엇입니까?
이 안드로이드의 연락처에ContentResolver를 사용하여 계정 유형을 얻으려면 어떻게해야합니까?
ContentResolver cr = getContentResolver();
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null,null, null);
if (cur.getCount() > 0) {
while (cur.moveToNext()) {
String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
Log.d("log : ","name : " + name + ", ID : " + id);
// get the phone number
Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
new String[]{id}, null);
while (pCur.moveToNext()) {
String phone = pCur.getString(
pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
String phone1 = pCur.getString(
pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
Log.d("log : ","phone" + phone + " type : "+phone1);
}
pCur.close();
'phone1'은 무엇을 제공합니까? –
phone1 내게 전화 번호 (직장, 집 등 ..) 유형을 알려주지 만 계정 유형 (whatsapp, viber, ..)을 원합니다. – ABOD