应用信息,包装信息和解决信息的使用 [英] Usage of Application Info , Package Info and Resolve Info

查看:83
本文介绍了应用信息,包装信息和解决信息的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序信息的用途是什么以及如何使用它. 我很困惑如何从设备中检索已安装的应用程序并显示徽标 谁能帮我解决一下. 区分术语应用信息",包装信息"和解决信息".

What is the use of Application info and how to use it. I'm confused how to retrieve the installed apps from the device and to display it with logo Can anyone please help me to sort it out. Differentiate the terms applicaiton info, package info and resolve info.

推荐答案

以显示已安装应用程序的列表,您可以尝试

to display a list of installed apps, you can try this

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

您将在ResolveInfo中获取所有必要的数据以启动应用程序.您可以检查 ResolveInfo

You will get all the necessary data in the ResolveInfo to start a application. You can check ResolveInfo

或尝试使用此代码

PackageManager pm = this.getPackageManager();

    Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);

    ArrayList<ResolveInfo> list = (ArrayList<ResolveInfo>) 
        pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);
        for (ResolveInfo rInfo : list) {
        System.out.println("Installed Applications " + rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());
        }

这篇关于应用信息,包装信息和解决信息的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆