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