How to send vcard as an sms/mms?

北城余情 提交于 2019-12-10 17:33:25

问题


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:


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);


来源:https://stackoverflow.com/questions/9697735/how-to-send-vcard-as-an-sms-mms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!