简体   繁体   中英

How can I open android contact app from web page?

I have an <a> tag in my HTML code. How can I open android contact app by clicking the <a>?

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

I assume you're not the creator of the contact app. So modifying the AndroidManifest.xml file isn't an option. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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