How to send vcard as an sms/mms?

2019-06-27 23:06发布

Hi everyone, I am working on an application,which has the functionality of sending vcard(vcf files),Ive generated a vcf file of a particular contact and able to send it using email, but i want to send it via sms / mms functionality and unable to do so.Ive gone through the forum , in many question they suggested sendDataMessage but it is not wokring for me.In some solutions they suggested Intent.EXRTA_STREAM , but it is also not working , so please give me an alternative way to send a vcard from my application or try to provide some code.Thanx

1条回答
你好瞎i
2楼-- · 2019-06-27 23:53

As you have generated .vcf file of vcard. then you can attach this file with the system's intent to send it as MMS.

    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.setType("text/x-vcard");
    sendIntent.putExtra(Intent.EXTRA_STREAM,
            Uri.parse(outputFile.toURL().toString()));
    startActivity(sendIntent);
查看更多
登录 后发表回答