【问题标题】:Android intent to open Instagram with a specified media id使用指定媒体 ID 打开 Instagram 的 Android 意图
【发布时间】:2015-06-28 14:06:28
【问题描述】:

鉴于我有 Instagram 图片的媒体 ID(12345_6789876 格式),有没有办法将其在 Intent 中传递给 Instagram 应用程序,以便在目标媒体中打开?

【问题讨论】:

    标签: android instagram instagram-api


    【解决方案1】:

    使用以下内容:

    Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.instagram.android");
    intent.setComponent(new android.content.ComponentName(
                "com.instagram.android",
                "com.instagram.android.activity.UrlHandlerActivity"));
    intent.setData(Uri.parse(mediaId));
    

    【讨论】:

    • 这不起作用。 UrlHandlerActivity 处理 instagram.com/p Uris(用于生成永久链接,例如单击“复制共享 URL”时),它不处理 media_id 数据...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-28
    • 2017-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多