Sorry for fonts.Here is the code to modify:

    public void Get_Contact_Name(String id)
    {
        String[] projection = new String[]
{ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
                ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,
                ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,
                ContactsContract.CommonDataKinds.StructuredName.SUFFIX,
                ContactsContract.CommonDataKinds.StructuredName.PREFIX,

ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME};

        String where = ContactsContract.Data.CONTACT_ID + " = ? AND " +
ContactsContract.Data.MIMETYPE + " = ?";
        String[] whereParameters = new String[]{id,
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE};

        Cursor contacts =
contentresolver.query(ContactsContract.Data.CONTENT_URI, projection, where,
whereParameters, null);

        if (contacts.moveToFirst()) {
            contactcontent.contact_display_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME))));
            contactcontent.contact_given_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME))));
            contactcontent.contact_suffix_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.SUFFIX))));
            contactcontent.contact_prefix_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.PREFIX))));
            contactcontent.contact_middle_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME))));
            contactcontent.contact_family_name =
Null_check((contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME))));
        }
        contacts.close();

    }


>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to