Hello, I am trying to get the emails from a contact on Android (2.0.1). I can´t get the email. The code I am using is:
String columns = new String[]{ContactsContract.Data._ID,
ContactsContract.Data.DATA1, ContactsContract.Data.DATA2,
ContactsContract.Data.DATA3,
ContactsContract.Data.DATA4,
ContactsContract.Data.DATA5,
ContactsContract.Data.DATA6,
ContactsContract.Data.DATA7,
ContactsContract.Data.DATA8,
ContactsContract.Data.DATA9
};
Cursor cursor = contentResolver.query(ContactsContract.Data.CONTENT_URI, columns, null, null, null);
When I try to get the values of the columns, I get null. How can I obtain the emails? Maybe the CONTENT_URI is not correct or tha data is stored in another table and I have to mkae a join.
Really, I don´t know what is the problem.
Thanks