Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/206.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android软件包管理器应用程序图标内存使用情况_Android - Fatal编程技术网

Android软件包管理器应用程序图标内存使用情况

Android软件包管理器应用程序图标内存使用情况,android,Android,我正在使用此代码安装应用程序 Intent appsIntent = new Intent(Intent.ACTION_MAIN, null); appsIntent.addCategory(Intent.CATEGORY_LAUNCHER); return this.packageManager.queryIntentActivities(appsIntent, 0); 而且,我正在使用这个工具在recyclerview适配器中加载应用程序图标 holder.ivAppIcon.setIma

我正在使用此代码安装应用程序

Intent appsIntent = new Intent(Intent.ACTION_MAIN, null);
appsIntent.addCategory(Intent.CATEGORY_LAUNCHER);
return this.packageManager.queryIntentActivities(appsIntent, 0);
而且,我正在使用这个工具在recyclerview适配器中加载应用程序图标

holder.ivAppIcon.setImageDrawable(resolveInfo.loadIcon(packageManager));

但是,若用户有很多应用程序,应用程序就会崩溃,内存异常。我使用了android:largeHeap=“true”,但我希望内存使用率低。我无法使用glide库,因为它无法加载可绘制对象。我能做什么?

请发布您的回收视图适配器代码,我认为您的回收不是回收。我在适配器中没有问题。图标加载成功。但是它使用80-150MB的内存@mhdjazmatic,这就是为什么你有一个问题,你的问题是你的回收视图没有回收!您可以通过添加Log.d(“something”,adapter.getposition)来实现这一点;在onBindViewHolder中,查看是否加载所有项目