[android-developers] Re: How to share image and text with SHARE INTENT on Facebook & Twitter?
Then it's impossible to achieve my needs with twitter?
On Nov 28, 2:49 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> You would have to ask the author of whatever Twitter client you are
> using (e.g., Twitter itself). There is nothing requiring any given
> Android application to simultaneously support text and streams with
> ACTION_SEND.
>
> BTW, never never never hardwire paths. Use
> Environment.getExternalStorageDirectory() to get the root of external
> storage.
>
> Also, I recommend using a real MIME type. You know the file is JPEG,
> so use image/jpeg. Otherwise, apps that can handle PNGs but not JPEGs
> might show up in the chooser.
>
>
>
>
>
>
>
>
>
> On Mon, Nov 28, 2011 at 8:41 AM, saex <elpablos...@gmail.com> wrote:
> > I want to give the user the possibility to share a Image and a Text
> > with Twitter and Facebook.
>
> > Actually my code can launch Android's share intent and if the user
> > selects Facebook, all works fine, the Image is attached and the text
> > is shown on the body of the new status.
>
> > But something is wrong with Twitter, if i only put a Image all works
> > fine, the image is detected by twitter and automatically uploaded to
> > twipic, then twitter posts the link of the image on the tweet. But if
> > i put a image and a text, then, twitter doesn't detect the image and
> > it only puts the text on the tweet, the image is ignored. What is
> > wrong?
>
> > this is my code:
>
> > Intent sharingIntent = new Intent(Intent.ACTION_SEND);
> > Uri screenshotUri = Uri.parse("file:///sdcard/image.jpg");
> > sharingIntent.setType("image/*");
> > sharingIntent.putExtra(Intent.EXTRA_TEXT, "Body text of the new
> > status");
> > sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
> > startActivity(Intent.createChooser(sharingIntent, "Share image
> > using"));
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home