从启动链接或电子邮件Android应用程序 [英] Launching Android Application from link or email

查看:167
本文介绍了从启动链接或电子邮件Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我一直在尝试推出从一个链接的应用程序上的电子邮件或从一些社交网站的一个帖子。我知道这个问题已经提出了一些朋友,但还是有问题,我面对的是,在某些设备上或在Android的一些Gmail应用程序不显示,我指定的锚标记或链接。

Hi guys i have been trying to launch the application from a link on email or from a posting on some social networking websites. I know this question has already been raised by some friends but still the problem that i face is that in some device or some gmail application on the android don't show the anchor tags or link that i have specified.

意向过滤器,我设置为我的活动如下:

The intent-filter that i set to my activity is below:

 <action android:name="android.intent.action.VIEW" />
 <category android:name="android.intent.category.DEFAULT" />
 <category android:name="android.intent.category.BROWSABLE" />
 <data android:scheme="myappname" />

和我与这个锚标记发送电子邮件

And i am sending the email with this anchor tag

myappname://processtobedone/?id=1

它工作正常的电子邮件应用程序,我对Huewai设备,但在设备的默认的Gmail应用程序未显示,它有一个链接,并在一些设备在默认情况下其追加的https:作为后缀的标记和启动浏览器。

It works fine with the email application that i have on Huewai device but in device's default gmail application it is not showing it has an link and in some devices by default it appends https: as suffix for the tag and launches the browser.

希望你能理解我的问题,希望能为更好的反应。

Hope you could understand my problem and hoping for the better response.

预先感谢。

推荐答案

而不是使用自定义的方案,你可以有一个&LT;意向滤光器&gt; 标识网址您可以控制​​:

Instead of using a custom scheme, you can have an <intent-filter> that identifies a URL that you control:

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

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

            <data
                android:host="www.this-so-does-not-exist.com"
                android:path="/something"
                android:scheme="http"/>
        </intent-filter>

然后,链接到 http://www.this-so-does-not-exist.com/something 将带给你的应用程序(在选择器,沿上有您的应用程序,并会带来上没有您的应用程序的设备您的网页。设备的Web浏览)

Then, links to http://www.this-so-does-not-exist.com/something will bring up your app (in a chooser, along with the Web browse) on devices that have your app, and will bring up your Web page on devices that do not have your app.

这篇关于从启动链接或电子邮件Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆