Вопрос

I wish to make option to share an image to all possible option. eg. mail, WhatsApp, Facebook etc. and I wish when the user share it there will be text addition. For example in Gmail I wish to add headline to mail before sending it, on Facebook also I would like to add text to the image. Do I need to add API to my app? Can you point me to the right direction with this.

Это было полезно?

Решение

First save the image to your SD card and then use the ACTION_SEND Intent.

http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND

Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/*");
share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + pathToFile));
ctx.startActivity(Intent.createChooser(share, "Share image")); //edit text shown in dialog here
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top