How to fetch the E Mail ID of A contact
<p>I am trying to fetch the E Mail address of A Contact.
I found <a href="http://stackoverflow.com/questions/6152442/how-to-get-contact-email-id">How to get contact email id?</a>     but I could not use this.</p>

<p>I have written following Code to fetch  Email</p>

<pre><code>             Cursor c1;
            c1 = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, ContactsContract.Contacts.DISPLAY_NAME);


            if(c1==null)
        return;
                    if(c1.getCount() &gt; 0)
            {
                    while(c1.moveToNext())
                    {

                        String id = c1.getString(c1.getColumnIndex(Contacts._ID));
                                                    if(id==null)
                            continue;
                                                    Cursor email_crsr = getContentResolver().query(CommonDataKinds.Email.CONTENT_URI, null, CommonDataKinds.Phone.CONTACT_ID +" = ?", new String[]{id}, null);
                        if(email_crsr!=null)
                              email = phone_crsr.getString(phone_crsr.getColumnIndex(CommonDataKinds.Email.DATA));

      }
    }
</code></pre>

<p>I am following Exception :
04-09 10:38:59.487: E/AndroidRuntime(8150): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 4</p>
