Ljudmila
Ljudmila

Reputation: 79

Android Instagram

please help! I want share my photo into Instagram. I use Intent for sharing, but I don't need at all list in Share, such as - Facebook, Instagram, Gmail, Bluetoth... etc. I need only Instagram. I want share photo into Instagram by only onclickListener. How can do it? thanks.

Upvotes: 2

Views: 14526

Answers (2)

sembozdemir
sembozdemir

Reputation: 4267

It is asked a long time ago. But the clear answer is not here. That's why, I want to answer as well.

I have been used that code below and it worked. It redirects to crop screen of instagram directly. (Of course, Instagram app must be installed on the device.)

...
Intent intent = createInstagramIntent("file://" + filePath);
startActivity(intent);
...

and

private Intent createInstagramIntent(String uriString) {
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setType("image/*");
    shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(uriString));
    shareIntent.setPackage("com.instagram.android");
    return shareIntent;
}

Upvotes: 9

Yahor10
Yahor10

Reputation: 2132

Create your custom sharing screen that call instagram.

Upvotes: -2

Related Questions