问题描述
我正在在我的应用程序,显示在用户设备中的所有已安装应用程序的视图的列表。它显示的名称和图标。列表视图需要很长时间来加载和用户界面是其时加载响应。我看到有懒加载和异步任务教程资源,但他们似乎都从互联网上获取的图像。我需要的是系统延迟加载图像(这是应用程序图标)。我不知道如何与异步任务做这一点。有人可以帮我懒负载或AsyncTask的应用程序图标。这是我的应用程序的一个非常重要的组成部分,我会深深AP preciate它。谢谢你。
I am making a list of view in my application that shows all installed applications in the users device. It shows the name and the icon. The list view takes very long to load and the UI is unresponsive while its loading. I have seen the resources that have lazy load and async task tutorials but they all seem to fetch images from the internet. I need to lazy load images that are in the system (which are the application icons). I dont know how to do this with async task either. Can someone please help me lazy load or asynctask application icons. This is a very essential part of my application and i would deeply appreciate it. Thanks.
推荐答案
所以我通常不提供意见,如果没有任何明确的尝试/ code,以示对,但我记得当我第一次面对与AsyncTasks和一般线程以及如何这是一个有点混乱在第一,所以我会得到你开始走上了正轨。
So I usually don't offer advice if there isn't any clear attempt/code to show for, but I remember when I was first confronted with AsyncTasks and threading in general and how it was a bit confusing at first, so I'll get you started on the right track.
因此,一个AsyncTask的基本上就是执行可能需要一段时间过程(如服务器负载信息,或者在你的情况下,获取文件)。它有几个方法,这些方法的详细概述看来真的是有帮助的。
As for the Lazy Load of the image data, I'm not completely sure how it works (never had to use it), but this seems really helpful.
希望这给了你一些方向。
Hope that gave you some direction.
这篇关于如何使用延迟加载或异步任务列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!