在运行时捕获/拦截Android Intent

use*_*319 18 android runtime android-intent

有没有办法在运行时捕获/拦截应用程序的Intent而不修改Android框架?修改Android框架可能需要太多工作.请帮我.

Jer*_*101 27

要在发生Intent时查看它们,请在shell中运行logcat并将其过滤到Intent,如下所示:

adb logcat | fgrep -i intent

(您也可以仅为应用的Intent添加过滤器,但这会排除系统和其他应用发送给您的应用的Intents.)

这应该显示Intents等

I/ActivityManager(585):开始活动:Intent {action = android.intent.action ...}

要查看系统范围的Intents,请尝试使用Intent Intercept应用程序.

要查看发送到您自己的类的所有Intent,那么

有关所有标准Intent操作的信息,请参阅Intent.