如何使链接打开该页面 Instagram 在安装的应用程序中 android?

我需要知道如何让链接打开页面 Instagram 在应用程序中,如果应用程序安装在智能手机上。

一种简单的方式,如
www.instagram.com/example

, 通过浏览器将您与页面绑定,这不是我想要的。

我该如何实现这一目标?
已邀请:

小姐请别说爱

赞同来自:

试试吧

:

建造 100%
<a href="instagram://user?username=untitled.tiff">untitled.tiff</a>

喜特乐

赞同来自:

跑步 instagram 来自浏览器。
开始 instagram 要创建它应该足以提供链接:


<a href="[url=http://instagram.com/p/&lt;picture]http://instagram.com/p/&lt;picture[/url] id&gt;">look at this instagram picture</a>


例子:
http://instagram.com/p/0nUyKnMJw4
instagram


<a href="[url=http://instagram.com/p/0nUyKnMJw4">look]http://instagram.com/p/0nUyKnMJw4">look[/url] at this instagram picture</a>


尝试在设备上打开此链接。 android. 另外,请记住 instagram 必须安装在设备上。
对于用户替换 "p" 在 "_u", 图像标识符 - 到用户名。

为什么它有效? 应用 instagram 有一个倾听的意图 http 和 https 意见


<data android:host="instagram.com" android:pathprefix="/p/" android:scheme="http"></data>
<data android:host="instagram.com" android:pathprefix="/p/" android:scheme="https"></data>
<data android:host="instagram.com" android:pathprefix="/_u/" android:scheme="http"></data>
<data android:host="instagram.com" android:pathprefix="/_u/" android:scheme="https"></data>
<data android:host="instagram.com" android:pathprefix="/_uid/" android:scheme="http"></data>
<data android:host="instagram.com" android:pathprefix="/_uid/" android:scheme="https"></data>
<data android:host="instagram.com" android:pathprefix="/_n/" android:scheme="http"></data>
<data android:host="instagram.com" android:pathprefix="/_n/" android:scheme="https"></data>


Edit: 看起来我有一个旧的清单文件。

八刀丁二

赞同来自:

它为我工作。


try {
// mediaLink is something like "[url=https://instagram.com/p/6GgFE9JKzm/"]https://instagram.com/p/6GgFE9JKzm/"[/url] or
// "[url=https://instagram.com/_u/sembozdemir"]https://instagram.com/_u/sembozdemir"[/url]
Uri uri = Uri.parse/mediaLink/;
Intent intent = new Intent/Intent.ACTION_VIEW, uri/;

intent.setPackage/"com.instagram.android"/;
startActivity/intent/;
} catch /ActivityNotFoundException e/ {
Log.e/TAG, e.getMessage///;
}

石油百科

赞同来自:

你可以打开 android intent 在锚链路浏览器上。 您可以获得的详细信息
https://developer.chrome.com/m ... tents

<a href="intent://instagram.com/#Intent;package=com.instagram.android;scheme=https;end">Open Instagram</a>

莫问

赞同来自:

我认为最好使用 Intent, 您可以使用 Intent 发送数据 intent/缩写 intent/ 是用来 "broadcast" 消息和侦听它的应用程序将反应。

看看它 email, 如果我要求品牌要做的事情,我会发一堆朋友,马克将回答,但是 rest 忽视 email.

您可以使用此代码发送意图。/它对您的问题有特点,但可以根据其他需求轻松编辑。/:


Intent insta_intent = getPackageManager//.getLaunchIntentForPackage/"com.instagram.android"/;
insta_intent.setComponent/new ComponentName/"com.instagram.android", "com.instagram.android.activity.UrlHandlerActivity"//;

//use this if you want to open an image
insta_intent.setData/Uri.parse/"[url=http://instagram.com/p/gjfLqSBQTJ/"//;]http://instagram.com/p/gjfLqSBQTJ/"//;[/url]

//And if you want to open a user's profile use this
insta_intent.setData/Uri.parse/"[url=http://instagram.com/_u/USER"//;]http://instagram.com/_u/USER"//;[/url]

startActivity/insta_intent/;

裸奔

赞同来自:

您可以尝试此方法。 您可以有一个开放的链接。 POPUP to choice 穿过 Instagram 或浏览器。
/此方法用于您想要的任何引用,而不仅仅是为了 Instagram./


***.setOnClickListener/new View.OnClickListener// {
@Override
public void onClick/View view/ {
String url = "Your URL";
Intent intent = new Intent/Intent.ACTION_VIEW/;
intent.setData/Uri.parse/url//;
startActivity/intent/;
}
}/;

要回复问题请先登录注册