【问题标题】:How to access the names of android apps? [closed]如何访问android应用程序的名称? [关闭]
【发布时间】:2015-08-23 17:10:04
【问题描述】:

我想在打开任何 android 应用程序时访问它们的名称,并将它们发送到云端。是否可以从系统中检索有关应用程序的信息? 如果是,我该怎么做?

【问题讨论】:

  • 应用程序是什么意思?请把你的问题说清楚。
  • @MarcinOrlowski 我尝试了一些东西,但没有任何效果......我删除了我之前编写的代码。
  • @AnixPasBesoin 我指的是你手机上的应用程序。

标签: java android android-studio


【解决方案1】:

首先检查此link 以更好地了解 ResolveInfo 类。

然后试试这段代码:

final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final List appsList = context.getPackageManager().queryIntentActivities( intent, 0);

您将在 ResolveInfo 中获得所有必要的数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-23
    • 2016-01-17
    • 2012-04-30
    相关资源
    最近更新 更多