1 获取已经安装的应用程序
/**
* 获取已安装应用信息
*
* @param includeSystemApps true:包含系统应用 false:不包含系统应用
*/
@SuppressWarnings("static-access")
private void getAppInfo(boolean includeSystemApps) {
PackageManager pm = this.getPackageManager();
appClassList.clear();
List<PackageInfo> packageInfos = this.getPackageManager().getInstalledPackages(0);
List<AppClass> sysApps = new ArrayList<>();
for (PackageInfo packageInfo : packageInfos) {
//过滤掉当前app
if (packageInfo.packageName.equals("startapp.cuanbo.startoneapp")) {
continue;
}
AppClass appInfo = new AppClass();