android - 如何从 Android 中的电子邮件 URL 打开已安装的应用程序?

标签 android email url twitter html-email

我想从电子邮件 URL 打开我的应用程序,基本上就像下面显示的示例 Twitter.com .

带有链接的电子邮件:

Email with link

选择打开应用或浏览器:

Select app or browser

点击应用选项后,Twitter 应用打开:

Open Twitter app

我尝试了以下代码,但它不起作用:

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

如果有人有正确的答案,请在这里写一些例子。

最佳答案

以下代码对我有用:

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

将电子邮件链接设置为 http://www.my.app.com/launch

引用:Launching Android Application from link or email

关于android - 如何从 Android 中的电子邮件 URL 打开已安装的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26052512/

相关文章:

android - Preferences.xml 中 PreferenceScreen 的 Intent

androidannotations 4.0.0 不显示布局

java.lang.NoClassDefFoundError : com/sun/mail/util/MailLogger while trying to send e-mail from JAX-WS

html - 对于我自己的而不是从其他网站借用的图像,正确的 img src 是什么?

来自 URL 的 Android 可绘制图像

session - 仅针对某些 url 在 tomcat 上禁用 session cookie

android textview settext 显示空指针异常

android - MPAndroidChart - 如何将 BarChart 的范围值设置为 2.0.9v?

java.lang.NoSuchMethodError : javax. mail.internet.ParameterList.combineSegments()V

java - 发送邮件可以在 Perl 中使用,但不能在 Java 中使用