Using share intent in android for instagram

2019-09-21 14:17发布

问题:

I want to share some image to instagram in my app. With facebook, twister... I know, I can do it by using Share Itent But wit instagram I don't know. Please help me. Thanks in advance!

回答1:

Here is a solution by using share intent

This is sample

Intent share = new Intent(Intent.ACTION_SEND);
                share.setType("image/jpeg");
                share.putExtra(Intent.EXTRA_STREAM,
             Uri.parse("file://"+Environment.getExternalStorageDirectory()+"/Pictures/jusgramm.jpg"));
                //share.putExtra(Intent.EXTRA_STREAM,data);
                startActivityForResult(Intent.createChooser(share, "Share Image Via"),SHARE_PIC_REQUEST);