从链接或电子邮件启动Android应用程序 [英] Launching Android Application from link or email
问题描述
我设置为我的活动的意图过滤器在下面:
< 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屋!