title: how to find duplicate contacts in list View
body: <p>I have developed app that access contacts via Content Resolver.It show all the contacts in one list view even duplicate contacts also shown on same list view  But i want to show duplicate contacts in other list view so that i can delete them according to my wish easily. Kindly Help me. Ill be thankful to you cordially .here is sample code.</p>
  
  <pre><code>package com.example.contentprovider;
  
  import android.content.ContentResolver;
  import android.content.Intent;
  import android.database.Cursor;
  import android.database.MatrixCursor;
  import android.provider.ContactsContract;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ListView;
  import android.widget.SimpleCursorAdapter;
  
  
  public class MainActivity extends AppCompatActivity {
  
  // Cursor Adapter for storing contacts data
  SimpleCursorAdapter adapter;
  
  // List View Widget
  ListView lvContacts;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // Init ListView
      lvContacts = (ListView) findViewById(R.id.lvContacts);
  
      // Initialize Content Resolver object to work with content Provider
      ContentResolver cr = getContentResolver();
  
      // Read Contacts
      Cursor c = cr.query(ContactsContract.Contacts.CONTENT_URI,
              new String[] { ContactsContract.Contacts._ID,
                      ContactsContract.Contacts.DISPLAY_NAME }, null, null,
              null);
  
  
      // Attached with cursor with Adapter
      adapter = new SimpleCursorAdapter(this, R.layout.row, c,
              new String[] { ContactsContract.Contacts.DISPLAY_NAME },
              new int[] { R.id.lblName });
  
      // Display data in listview
      lvContacts.setAdapter(adapter);
  
  }
  }
  </code></pre>