如何启动Android中从浏览器的活动? [英] How to launch an activity from browser in android?
本文介绍了如何启动Android中从浏览器的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以启动从Android浏览我的活动?
我有一个链接说,的http:// ABCOM 。我需要当用户在Android浏览器的URL打开活动。我有以下意图过滤器在我的Android清单:
<意向滤光器>
<作用机器人:名称=android.intent.action.MAIN/>
<类机器人:名称=android.intent.category.LAUNCHER/>
&所述; /意图滤光器>
<意向滤光器>
<数据机器人:计划=HTTP机器人:主机=ABCOM/>
<作用机器人:名称=android.intent.action.VIEW/>
<类机器人:名称=android.intent.category.DEFAULT/>
<类机器人:名称=android.intent.category.BROWSABLE/>
&所述; /意图滤光器>
解决方案
看看如何注册某些URL命名空间(的myapp:/ /app.start/)通过调用浏览器的URL在Android操作系统访问你的程序?
(不要感到迷惑的问题的标题。答案是相关的。)
How can I launch my activity from android browser?
I have a link say,http://a.b.com. I need to open activity when user enters that URL in android browser. I have the following intent filters in my android manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="a.b.com"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
解决方案
Take a look at How to register some URL namespace (myapp://app.start/) for accessing your program by calling a URL in browser in Android OS?
(Don't get stuck at the title of the question. The answers are relevant.)
这篇关于如何启动Android中从浏览器的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文