获取手机上安装的应用信息

  public Map getAppInfoMap(String paramString)
  {
    try
    {
      HashMap localHashMap = new HashMap();
      PackageManager localPackageManager = this.b.getPackageManager();
      Intent localIntent = new Intent("android.intent.action.MAIN", null);
      localIntent.addCategory("android.intent.category.LAUNCHER");
      List localList = localPackageManager.queryIntentActivities(localIntent, 1);
      for (int j = 0; j < localList.size(); j++)
      {
        ResolveInfo localResolveInfo = (ResolveInfo)localList.get(j);
        if (localResolveInfo.activityInfo.packageName.equals(paramString))
        {
          String str1 = localResolveInfo.loadLabel(localPackageManager).toString();
          int k = localResolveInfo.activityInfo.applicationInfo.icon;
          String str2 = localResolveInfo.activityInfo.name;
          if ((str2 != null) && (!"".equals(str2.trim())))
          {
            localHashMap.put("appName", str1);
            localHashMap.put("appIcon", Integer.valueOf(k));
            localHashMap.put("activityName", str2);
            return localHashMap;
          }
        }
      }
    }
    catch (Exception localException)
    {
    }
    return null;
  }

获取手机上安装的应用信息,布布扣,bubuko.com

获取手机上安装的应用信息

上一篇:【HCI】Cognitive Theory 大脑分工(快慢+优缺点)


下一篇:[WP8] 使用ApplicationMenu与使用者互动