android读取应用列表权限,Android获取系统应用及安装应用的权限列表

主要通过PackageManager中的方法

代码:

public class InstallApps extends ListActivity {

HashMap map=new HashMap();

List packagelist=new ArrayList();

List systemApp=new ArrayList();

protected void onCreate(android.os.Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

PackageManager pm=getPackageManager();

//List mPackageinfo=  pm.getInstalledPackages(PackageManager.GET_PERMISSIONS);

Intent query=new Intent(Intent.ACTION_MAIN);

query.addCategory("android.intent.category.LAUNCHER");

List resolves= pm.queryIntentActivities(query, PackageManager.GET_ACTIVITIES);

for (int i = 0; i < resolves.size(); i++) {

ResolveInfo info= resolves.get(i);

/ /判断是否为系统级应用

if((info.activityInfo.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM)&

你可能感兴趣的:(android读取应用列表权限)