Not overwritng same android phone contact
<p>I am making an application in which i have to saved user contact information. I am successfully able to save information like name, homePhone, workPhone, cellPhone and addresss. now, where m stuck, before saving information i want to check if there already exist same contact only by matching name, i m able to check. Basically i have to show dialog box to user whether user wants to overwrite same contact or not. if Yes, in android phone contact same contact occur multiple times. This is what i dont want.</p>

<p>What m thinking is if user say yes, first i delete that contact from phone and then save the same contact. But i dont know how to delete contact by name.</p>

<p>Please help</p>

<p>I hve solved problem on behalf of myself.</p>

<p>Here is how:
                  String where =  ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME+"=?";
String[] args = new String[] {f+" "+l};
cr.delete(ContactsContract.Data.CONTENT_URI, where, args );</p>
