【发布时间】:2018-06-07 18:52:14
【问题描述】:
我已经使用
成功地向我的 SyncReceiver(BroadcastReceiver) 发送了没有额外内容的意图adb -s <ip_address> shell am broadcast -a com.istock.ALERT
但是,当我添加额外内容时,从不会调用 SyncReceiver 的 OnReceive 事件,这是发送带有额外内容的意图的示例
adb -s <ip_address> shell am broadcast -a com.istock.ALERT --es title "Alert Title"
我发现 post on SO 有几乎相同的问题,但是当我实施修复时,它仍然没有调用 SyncReceiver 的 OnReceive 事件
adb -s <ip_address> shell am broadcast -a com.istock.ALERT -n com.istock/.SyncReceiver --es title "Alert Title"
此时我只是不明白为什么我可以在没有通过 adb 发送的额外内容的情况下接收意图,并且无法接收有额外内容的意图任何想法?
【问题讨论】:
-
首先启动 shell
adb -s <ip_address> shell然后运行你的am broadcast命令 -
你是个成功的人,谢谢大家
-
再次感谢您,这将使整合到移动设备管理应用程序中变得更加容易。
标签: android android-intent adb android-broadcast android-broadcastreceiver