Logging broadcast Intents and manually trigger the

2019-07-21 15:43发布

问题:

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.