While trying to retrieve a contact list from android using the below code it returns multiple accounts like google/gmail, whatsapp, and soma (how many accounts are activated depends on the number content resolver returns for that much copy of contact !). Please help me to remove it.
cursor1=getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI ,null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME +" ASC");
startManagingCursor(cursor1);
String[] from = {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone._ID,};
int[] to = {android.R.id.text1, android.R.id.text2};
listadapter = new SimpleCursorAdapter(getBaseContext(), android.R.layout.simple_list_item_2, cursor1, from, to);
setListAdapter(listadapter);