简体   繁体   English

如何从 web 页面打开 android 联系人应用程序?

[英]How can I open android contact app from web page?

I have an <a> tag in my HTML code.我的 HTML 代码中有一个 <a> 标记。 How can I open android contact app by clicking the <a>?如何通过单击 <a> 打开 android 联系人应用程序?

<a href="#">button</a>

Apps handle links through intents:应用程序通过意图处理链接:

<intent-filter>
<data android:scheme="contactapp" android:host="contactapp.com"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>

So when the user clicks on contactapp://contactapp.com he is transferred to the app that has the intent filter above.因此,当用户点击contactapp://contactapp.com时,他会被转移到具有上述意图过滤器的应用程序。

I assume you're not the creator of the contact app.我假设您不是联系人应用程序的创建者。 So modifying the AndroidManifest.xml file isn't an option.所以修改 AndroidManifest.xml 文件不是一个选项。 The next best thing you can do is put an empty phone number in the link.您可以做的下一个最好的事情是在链接中输入一个空的电话号码。 But that only opens the dialer app and not the contacts app.但这只会打开拨号器应用程序,而不是联系人应用程序。

<a href="tel://">Click me</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM