我正在使用这段代码获取手机上应用程序的列表,但如何在屏幕上显示它们呢?
final PackageManager pm = getPackageManager();
List<applicationinfo> packages = pm
.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages) {
Log.d(TAG, "Installed package :" + packageInfo.packageName);
Log.d(TAG,
"Launch Activity :"
+ pm.getLaunchIntentForPackage(packageInfo.packageName));
}
我正在尝试在列表视图中显示它们,但遇到了一些问题。请问有人可以帮忙吗?