Android - Intent.setType() arguments

老子叫甜甜 提交于 2019-12-24 04:52:12

问题


Does anyone know all available arguments for this method? Like "image/..." or "file/..."? I didn't found a clue for that list in official documentation.

Speccially, I need an intent to send contact (.vcf) file. But type "file/vcf" doesn't show me send via sms option.

sendIntent.setData(Uri.parse("sms:"))

Also didn't help

Thanks


回答1:


The Intent.setType() takes the MIME type as an argument.

The MIME type is text/vcard




回答2:


How about Intent.setAction? For example to send sms:

intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("sms:" + phonenumberhere));

Action View is kind of a generic handler in this case, but when combined with phonenumber and sms it will send text.



来源:https://stackoverflow.com/questions/10614891/android-intent-settype-arguments

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