Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share intent for instagram in Android

Actually I want to share image in Instagram through intent.

I found this solution for images saved on SD card but I want to do same for image on site (link).

I tried with

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("image/*");
    shareIntent
            .putExtra(
                    Intent.EXTRA_STREAM,
                    Uri.parse("http://www.alliswell.biz/images/products/art/alliswell_signs/yellowB.jpg"));
    shareIntent.setPackage("com.instagram.android");
    startActivity(shareIntent);

But it's not working.

Edit

When I start above intent it opens my installed Instagram application and it immediately finish Instagram and toast message comes "unable to download file"

Actually it does not parse link and image respectively. What should be issue?

like image 418
Bhavesh Hirpara Avatar asked Apr 30 '13 10:04

Bhavesh Hirpara


People also ask

What is Share intent Android?

Android uses Intents and their associated extras to allow users to share information quickly and easily, using their favorite apps. Android provides two ways for users to share data between apps: The Android Sharesheet is primarily designed for sending content outside your app and/or directly to another user.

How do you share photos on Instagram Android?

Instagram app for AndroidAt the top, tap then scroll to Post at the bottom: To upload a photo from your phone's library, select the photo you'd like to share.

What is share to Feed on Instagram?

With Sharing to Feed, you can allow your app's Users to share your content to their Instagram Feed.


1 Answers

You should use local path to file

For example: "file:///path/to/file/image.png".

Note, that it is very important to include "file" in the path, without this part it also can show the same toast.

like image 119
Zakharov Roman Avatar answered Oct 03 '22 23:10

Zakharov Roman