2

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

UnknownJoe
  • 599
  • 5
  • 14
  • 30

2 Answers2

4

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

The MIME type is text/vcard

Community
  • 1
  • 1
Terence Eden
  • 14,034
  • 3
  • 48
  • 89
  • It's very close, but I have nullpointerexception when I'm trying to send MMS with vCard Here is the code: Intent sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(outputFile)); sendIntent.setType("text/vcard"); – UnknownJoe May 17 '12 at 16:42
0

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.

Tisho
  • 8,320
  • 6
  • 44
  • 52