Android的Instagram的 [英] Android Instagram

查看:235
本文介绍了Android的Instagram的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮忙!我想分享我的照片到Instagram的。我使用意向共享,但我并不需要在所有列表中共享,如 - 脸谱,Instagram的,Gmail中,Bluetoth ...等我只需要Instagram的。我希望通过只onclickListener分享照片到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.

推荐答案

这是很久以前的问道。但明确的答案不在这里。这就是为什么我要回答为好。

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

我一直在用低于code和它的工作。它重定向到直接作物的Instagram的屏幕。 (当然,Instagram的应用程序必须安装在设备上。)

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);
...

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;
}

这篇关于Android的Instagram的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆