Is it possible to get contacts that are displayed at official contacts application?
I tried to retrieve contacts in this way:
contentResolver = ApplicationSingleton.getInstance().getContentResolver();
String[] projection = new String[]{ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.HAS_PHONE_NUMBER, ContactsContract.Contacts.STARRED};
String selection = null;
Cursor cursor = contentResolver.query(ContactsContract.Contacts.CONTENT_URI, projection, selection, null, null);
while (cursor.moveToNext()) {
String name = (cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
Log.d("CONTACT: ", name);
}
cursor.close();
but then I get all contacts which are connected to my email.
Thanks.