如何从Android中的电子邮件网址打开已安装的应用程序

如何从Android中的电子邮件网址打开已安装的应用程序

本文介绍了如何从Android中的电子邮件网址打开已安装的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从电子邮件网址打开我的应用程序,基本上就像下面的


I want to open my app from an email URL, basically like the example shown below for Twitter.com.

Email with link:

Selection to open app or browser:

After you click on the app choice, the Twitter app opens:

I tried the following code, but it is not working:

<intent-filter>
    <action android:name="android.intent.action.VIEW"></action>
    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>
    <data android:host="www.twitter.com" android:scheme="http"></data>
</intent-filter>

If anyone has a proper answer, please write some examples here.

解决方案

The following code worked for me:

<intent-filter>
    <action android:name="android.intent.action.VIEW"></action>

    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>

    <data
        android:host="www.my.app.com"
        android:path="launch"
        android:scheme="http"></data>
</intent-filter>

With the email link set as http://www.my.app.com/launch.

Ref: Launching Android Application from link or email

这篇关于如何从Android中的电子邮件网址打开已安装的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 19:05