赞
踩
主要通过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)&
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。