Use the following code to read the data.

Cursor cursor = mResolver.query( Data.CONTENT_URI, null, where, null,
Data.DISPLAY_NAME );
if( cursor != null ) {
    while( cursor.moveToNext() ) {
        String rawContactID =
cursor.getString( cursor.getColumnIndex( Data.RAW_CONTACT_ID ) );
        String mimetype =
cursor.getString( cursor.getColumnIndex( ContactsContract.Data.MIMETYPE ) );
        if( mimetype.equals( StructuredName.CONTENT_ITEM_TYPE ) ) {
            // Read name : Field = StructuredName.DISPLAY_NAME
        }
        else if( mimetype.equals( Relation.CONTENT_ITEM_TYPE ) ) {
            // Read birthdate : Field = Relation.DATA
        }
        // Note : The name and the birthday will be there in different
entries
        // So make sure that you match them properly and maintain it
accordingly
    }
}

On Mar 10, 11:38 pm, Mark Murphy <[email protected]> wrote:
> Nox wrote:
> > Thank you for your replies,
> > but unfortunately it doesn t work.
> > If I open my app there ll appear the error message:
>
> > The application has stopped unexpectedly. Please try again.
>
> > Do you know what I have to do now?
>
> Use adb logcat, DDMS, or the DDMS perspective in Eclipse to look at the
> Java stack trace that was generated when that dialog appeared. It should
> give you some clues for fixing your problem.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_
> Version 1.3 Available!

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

Reply via email to