need method to compare given name string with names in address book
is there any 开发者_开发技巧method to compare given string with names in address book of android like using ContactsContract?
for the u need to compare the string to the each contact list list and set this name in one of the collection like listArray . here is the code from that u can fetch the contact list name
Cursor cursor = getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
new String[] { Phone._ID, Phone.DISPLAY_NAME, Phone.NUMBER },
null, null, null);
/* Cursor cursor = getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
null, null, null);*/
startManagingCursor(cursor);
cursor.moveToFirst();
cursor.getColumnCount();
// // Log.i("CURSOR COLUMN IS ", ""+cursor.getColumnCount());
for (int i = 0; i < cursor.getCount(); i++) {
contactName.add(cursor.getString(1));
// // // Log.i("NAME OF LIST CONTACT", "" + cursor.getString(3));
cursor.moveToNext();
}
精彩评论