0

I am new to Android development. And I am trying build an app which scans all installed Apps for implicit intend calls. So if an application has implicit call then this app shows the name of the apps. Can someone provide me some concept on how to do it? If this not possible, then is it possible to notify when application gets called implicitly?

4

1 回答 1

1

您可以通过查询获取所有已安装应用程序的列表,PackageManager还可以获取每个包的启动意图。(即带有类别的包Intent.CATEGORY_LAUNCHER

final PackageManager pm = getPackageManager();
//get the list of all installed packages.
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);

for (ApplicationInfo packageInfo : packages) {
    Log.d(TAG, "Installed package :" + packageInfo.packageName);
    Log.d(TAG, "Launcher Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName)); 
}
于 2013-04-18T04:18:28.457 回答