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

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

问题描述

我一直在尝试从电子邮件链接或某些社交网站上发布的应用程序。我知道这个问题已经被一些朋友提出,但是我仍然面临的问题是,在某些设备或Android上的一些gmail应用程序中,并没有显示我指定的锚标签或链接。



我设置为我的活动的意图过滤器在下面:

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

我正在使用此锚点发送电子邮件

  myappname:// processtobedone /?id = 1 

它与我在Huewai设备上的电子邮件应用程序正常工作,但在设备的默认gmail应用程序中,它没有显示它有一个链接,在某些设备默认情况下,它附加https:作为标签的后缀并启动浏览器。 / p>

希望你能理解我的问题,希望能有更好的回应。



感谢Advance。

解决方案

而不是使用自定义方案,您可以拥有一个< intent-filter> 标识您控制的URL:

 < 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
机器人:方案= HTTP/>
< / intent-filter>

然后,链接到 http://www.this-so-does -not-exist.com/something 将在您的应用程序的设备上显示您的应用程序(在选择器中以及Web浏览器),并将在不具有应用程序的设备上启动您的网页有你的应用程序。


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

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.

Thank in Advance.

解决方案

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>

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天全站免登陆