Logging broadcast Intents and manually trigger them (Android)

冷暖自知 提交于 2019-12-11 01:26:18

问题


during my development in android I've missed a function that can log every broadcast intent that occur. Sometimes it had been very useful to have a function like that...

I'm also wondering how to trigger those broadcast intents manually on the emulator.

Is there an entire overview of available broadcast intents?

Would be great if someone would have some answers,

greets, poeschlorn


回答1:


during my development in android I've missed a function that can log every broadcast intent that occur

They are logged to LogCat. Use adb logcat, DDMS, or the DDMS perspective in Eclipse to view them.

I'm also wondering how to trigger those broadcast intents manually on the emulator

For the ones you are allowed to send, call sendBroadcast(). For system-generated ones, you generally cannot "trigger" them "manually".

Is there an entire overview of available broadcast intents?

Not really. Check out the documentation for Intent. All of the ACTION_ strings whose comment says "Broadcast Action" are broadcast Intents. There are a few other scattered elsewhere in the system.



来源:https://stackoverflow.com/questions/2943198/logging-broadcast-intents-and-manually-trigger-them-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!