How to import multiple .vcf file programmatically in android?
Asked Answered
P

2

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.

Peeples answered 16/4, 2015 at 4:0 Comment(0)
I
1

Use Intent.ACTION_PICK instead of Intent.ACTION_VIEW

Introit answered 16/4, 2015 at 7:37 Comment(0)
C
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

Carbajal answered 7/11, 2017 at 9:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.