I am creating a app where i need to backup and restore contacts programmatically to and from my website.
Here i have completed one part(backup contacts).
In the other part(importing contacts) i use this code.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+File.separator+"Contacts.vcf")),"text/x-vcard"); //storage path is path of your vcf file and vFile is name of that file.
startActivity(intent);
This code works 90% perfectly,only one problem is that when this code gets called a alert dialogue gets displayed and we have to manually select where to restore the contacts.
e.g Phone,email id
How can i make it auto called,so that whenever this code gets called Contacts gets restored automatically to Phone memory ?