public List<AppInfo> getAllAppInfo(){
PackageManager pm = m_context.getPackageManager();
List<ApplicationInfo> applicationinfos=pm.getInstalledApplications(0);
lAppInfo =new ArrayList<AppInfo>();
for(ApplicationInfo app:applicationinfos){
// if(FilterSystemApp(app)){
appInfo = new AppInfo();
appInfo.setAppName((String)app.loadLabel(pm));
appInfo.setDrawable(app.loadIcon(pm));
// appInfo.setPackageName(app.packageName);
// String className=getClassName(app.packageName);
// appInfo.setClassName(className);
lAppInfo.add(appInfo);
// }
}
return lAppInfo;
}
------ Solution ------------------------------------- -------
look at this can help you
http://www.cnblogs.com/Ryandroid/archive/2011/11/25/2263226.html
------ eference ------------- --------------------------
you are not wrong ? Best use of hard-coded , rear aspect also maintenance .
/ / check all the applications already installed
List
. getInstalledApplications ( PackageManager.GET_UNINSTALLED_PACKAGES );
Collections.sort (listAppcations,
new ApplicationInfo.DisplayNameComparator (pm)) ;/ / Sort
List
没有评论:
发表评论