当我在Android应用程序中捕获adb logcat
时。我在下面看到日志:
ActivityManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE]
我不明白上面日志中的act and cat
是什么意思。它们与ActivityManager有关吗?我在文档中找不到任何线索。
答案 0 :(得分:1)
act
代表Action
,cat
代表Category
更多详细信息为here
答案 1 :(得分:0)
act
表示操作,cat
表示类别。
下面是Intent.toString
的摘要:
public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras,
boolean clip) {
boolean first = true;
if (mAction != null) {
b.append("act=").append(mAction); // Action
first = false;
}
if (mCategories != null) {
if (!first) {
b.append(' ');
}
first = false;
b.append("cat=["); // Categories
for (int i=0; i<mCategories.size(); i++) {
if (i > 0) b.append(',');
b.append(mCategories.valueAt(i));
}
b.append("]");
}
// ...
您之所以在日志中看到此消息的原因很可能是因为意图已由某个应用程序或服务调度,因此系统可以决定使用特定操作和类别来处理意图的应用程序。 / p>