Share functionality

5 views
Skip to first unread message

Joshua Herman

unread,
Dec 10, 2010, 2:39:52 PM12/10/10
to chicago-...@googlegroups.com
Can someone give an example or tell me where to find in the
documentation of implementing the share functionality in android?

Nicholas Aiello

unread,
Dec 10, 2010, 3:03:01 PM12/10/10
to chicago-...@googlegroups.com
do you want to use the ACTION_SEND intent, or have your app show up under the share option?

Regards,

-nick-

On Fri, Dec 10, 2010 at 1:39 PM, Joshua Herman <zitterb...@gmail.com> wrote:
Can someone give an example or tell me where to find in the
documentation of implementing the share functionality in android?

--
You received this message because you are subscribed to the Google Groups "Chicago Androids" group.
To post to this group, send email to chicago-...@googlegroups.com.
To unsubscribe from this group, send email to chicago-androi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chicago-androids?hl=en.


Joshua Herman

unread,
Dec 10, 2010, 5:02:31 PM12/10/10
to chicago-...@googlegroups.com

Action send intent.

On Dec 10, 2010 2:03 PM, "Nicholas Aiello" <nikko....@gmail.com> wrote:
> do you want to use the ACTION_SEND intent, or have your app show up under
> the share option?
>
> Regards,
>
> -nick-
>
> On Fri, Dec 10, 2010 at 1:39 PM, Joshua Herman <zitterb...@gmail.com>wrote:
>
>> Can someone give an example or tell me where to find in the
>> documentation of implementing the share functionality in android?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Chicago Androids" group.
>> To post to this group, send email to chicago-...@googlegroups.com.
>> To unsubscribe from this group, send email to

Nicholas Aiello

unread,
Dec 10, 2010, 11:48:45 PM12/10/10
to chicago-...@googlegroups.com
it's pretty straight forward. what type of data do you want to share? i've included an example for sharing an image, and email.



IMAGE

// get the Uri for the image, Uri.fromFile or whichever
Uri imageUri = ...
Intent imageIntent = new Intent(Intent.ACTION_SEND);
imageIntent.setDataAndType(imageUri, "image/jpeg");
intent = Intent.createChooser(imageIntent, "Share...");

EMAIL

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{user.email});
//intent.putExtra(android.content.Intent.EXTRA_SUBJECT, mySubject);
//intent.putExtra(android.content.Intent.EXTRA_TEXT, myBodyText);

// this will bring up a chooser using the specified title
intent = Intent.createChooser(emailIntent, "Send mail...");



You should be able to use the above examples to get started. 

Joshua Herman

unread,
Dec 10, 2010, 11:55:09 PM12/10/10
to chicago-...@googlegroups.com
I want to share text data. Thanks for the help!

On Fri, Dec 10, 2010 at 10:48 PM, Nicholas Aiello

Reply all
Reply to author
Forward
0 new messages