【发布时间】:2014-01-28 19:51:05
【问题描述】:
我有一个带有以下意图过滤器的活动 A
<activity
android:name="com.comp.pac.ActivityA">
<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:scheme="customapp"
android:host="show"
android:path="/"/>
</intent-filter>
</activity>
我基本上是在按照here 解释的那样在意图过滤器中尝试自定义数据方案
为了测试 IntentUri 是否启动活动,我尝试通过终端使用以下命令触发意图:
adb shell am start intent://show/#Intent;scheme=customapp;package=com.comp.pac;end
我收到以下错误:
Activity 未启动,无法解析 Intent { act=android.intent.action.VIEW dat=intent://show/ flg=0x10000000 }问题:命令有什么问题吗?如果不是,那么测试 Intent uri 是否启动 Activity 的最简单方法是什么?
here 提供了使用 adb 命令使用 Intent uri 启动活动的说明。
【问题讨论】:
-
adb shell 'am start "intent:////show/#Intent;scheme=customapp;package=com.comp.pac;end"' 它将解决您的问题它将启动您的活动
标签: android android-intent adb intentfilter url-scheme