【发布时间】:2015-06-23 16:35:28
【问题描述】:
我有一个具有如下意图过滤器的 BroadcastReceiver:
<receiver
android:name="com.mytestpackage.ExternalLinksBroadcastReceiver"
android:exported="true"
android:enabled="true">
<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="test.me"
android:path="/static/"
android:scheme="http"/>
</intent-filter>
</receiver>
我想从广播接收器打开这样的链接。
http://test.me/static/someone-1111"
接收者的 OnReceive 我从 Intent 中提取用户 ID 并尝试在应用内显示相应的配置文件。
这不起作用。现在,当我使用上面的方案单击 Facebook 或其他地方的共享链接时,该链接来自我们的网站,它无法识别已安装的应用程序。
【问题讨论】:
-
显示 whole 清单,而不仅仅是
<intent-filter>块 -
顾名思义,广播接收器接收广播。 URL 不是广播。
标签: android broadcastreceiver intentfilter