gpt4 book ai didi

android - 无需登录 Android 中的 Instagram 应用程序即可在 Instagram 中分享

转载 作者:太空狗 更新时间:2023-10-29 15:26:27 26 4
gpt4 key购买 nike

我正在实现以下代码以在 Instagram 上共享图像和文本:

public void ShareInstagram() {
Log.e("SHARE", "IN INSTAGRAM");
Intent intent = getActivity().getPackageManager()
.getLaunchIntentForPackage("com.instagram.android");
if (intent != null) {
String type = "image/*";
Intent share = new Intent(Intent.ACTION_SEND);
share.setType(type);

share.putExtra(Intent.EXTRA_STREAM, file);
share.putExtra(Intent.EXTRA_TEXT, SHARE_NAME);
share.setPackage("com.instagram.android");
share.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Broadcast the Intent.
startActivity(share);
} else {
Intent inplay = new Intent(Intent.ACTION_VIEW);
inplay.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
inplay.setData(Uri.parse("market://details?id="
+ "com.instagram.android"));
startActivity(inplay);
}

}

当我从我的应用程序在 instagram 中分享并且我没有登录 instagram 时,它会打开 instagram 应用程序的登录或注册屏幕,并显示必须登录才能共享的 toast 消息。之后,当我按下后退按钮时,我将转到我的应用程序并恢复共享 Activity 。但我无法访问任何屏幕控制。如果我再按一次,那么只有我可以访问它。

此问题仅在我未登录 instagram 应用程序时出现。帮助我找到合适的解决方案。

最佳答案

我也注意到了这个问题。好像是instagram版本的问题。我用的是旧的。更新到最新版本后,该问题已解决。

关于android - 无需登录 Android 中的 Instagram 应用程序即可在 Instagram 中分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29698371/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com