ResolveInfo.loadLabel 和 PackageItemInfo.loadLabel 有什么区别?

What's the difference between ResolveInfo.loadLabel and PackageItemInfo.loadLabel?

两个 类 ResolveInfo and ApplicationInfo (which extends PackageItemInfo) 都有 loadLabel 到 "current textual label associated with this item" 的方法。我尝试了 运行 以下代码,第一个块打印出通过意图查询获得的与 Play Music 应用关联的标签,第二个块打印出通过使用包查询获得的与应用关联的标签姓名。第一个打印 "Play Music" 但第二个打印 "Google Play Music"。这是怎么回事?

    PackageManager pm = getPackageManager();

    Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    List<ResolveInfo> activities = pm.queryIntentActivities(intent,
            PackageManager.GET_META_DATA);
    for (ResolveInfo activity : activities) {
        // prints out "Play Music"
        Log.d("butt", "" + activity.loadLabel(pm));
    }

    ApplicationInfo appInfo = null;
    try {
        appInfo = pm.getApplicationInfo("com.google.android.music", 0);
    } catch (NameNotFoundException e) { }
    if (appInfo != null) {
        // prints out "Google Play Music"
        Log.d("butt", "" + appInfo.loadLabel(pm));
    }

ApplicationInfo documentation:

您可以检索的有关特定应用程序的信息。这对应于从 AndroidManifest.xml 的标签收集的信息。

ResolveInfo documentation:

根据 IntentFilter 解析意图返回的信息。这部分对应于从 AndroidManifest.xml 的标签收集的信息。

从上面看来,Google Play Music 是应用程序的名称,Play Music 是响应意图的应用程序中 activity 的名称。