9

I have multiple vcf files in my sdcard. I want import those vcf files into my contacts.

I am using the below code :

File file = new File(storage_path);
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(file), "text/x-vcard");
        startActivity(intent);

By using above code i can unable to import one vcf file at a time. I want to import multiple vcf files at a time. By using above code i am getting duplicate contacts also.

Is there any other efficient way to import contacts except intent ? Thank you.

Siri
  • 701
  • 1
  • 6
  • 27

2 Answers2

1

Use Intent.ACTION_PICK instead of Intent.ACTION_VIEW

Naren
  • 56
  • 4
0

Android has nothing built-in for vCard import, in terms of a traditional Java API. There is this third-party library and perhaps others, you can Use This Library to impliment any requirement

Ahmad Ronagh
  • 790
  • 10
  • 16