Android:从浏览器打开应用程序

时间:2011-08-12 04:46:11

标签: android-manifest

我需要从浏览器打开我的应用程序,当一些模式匹配网址到来时,我已经使用Intercepting links from the browser to open my Android app实现。它仅用于网址才可以打开应用程序。我想在浏览器查找时使用应用程序像appname:// id = 102。

这样的字符串

谢谢。

编辑:请查看我使用的代码

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

                 <data 
                  android:scheme="appname"
                />      
    </intent-filter>

1 个答案:

答案 0 :(得分:1)

您需要为包含数据标记的活动添加intent过滤器。在数据标记中,您可以设置要侦听的方案。像这样:

<intent-filter>
    <data android:scheme="appname" />
</intent-filter>