According to
http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=src/com/android/camera/MenuHelper.java:
579 Intent intent = new Intent();
580 intent.setAction(Intent.ACTION_SEND);
581 String mimeType = image.getMimeType();
582 intent.setType(mimeType);
583 intent.putExtra(Intent.EXTRA_STREAM, u);
584 boolean isImage = ImageManager.isImage(image);
585 try {
586 activity.startActivity(Intent.createChooser
(intent,
587 activity.getText(isImage
588 ? R.string.sendImage
589 : R.string.sendVideo)));
590 } catch
(android.content.ActivityNotFoundException ex) {
591 Toast.makeText(activity, isImage
592 ? R.string.no_way_to_share_image
593 : R.string.no_way_to_share_video,
594 Toast.LENGTH_SHORT).show();
595 }
I have basically the same code and neither Twitdroid nor Facebook
respond to it like Gallery. Maybe it has something to do with how the
Uri is constructed or image file permissions?
If you solve this problem, please let me know.
Best,
H.
On 27 sep, 14:38, Mark Buchholz <[email protected]>
wrote:
> I'm trying to setup anintentthat allows users to share an Jpeg,
> stored in the applications file cache.
>
> Trying this:
>
> Intenti = newIntent(Intent.ACTION_SEND );
> i.putExtra(Intent.EXTRA_STREAM, uri );
> i.setType( "image/jpeg" );
> startActivity(Intent.createChooser( i, "Where to share?" ) );
>
> It works for the eMail application, but not for any other app (like
> Facebook orTwitdroid). Gallery supports them. Does anyone know, how
> exactly Gallery does it?
>
> Thanks for any help!
> Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---