开发者

need method to compare given name string with names in address book

开发者 https://www.devze.com 2023-03-20 06:33 出处:网络
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

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();
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号