简体   繁体   English

Android,我该如何从缓存中放入/加载图像?

[英]android, how do i put/load images from cache memory?

I my project I have an activity which has a grid view. 我的项目中有一个具有网格视图的活动。 This grid view will show images which are loaded from the Internet. 此网格视图将显示从Internet加载的图像。 Everything is fine and I can see my images in activity. 一切都很好,我可以在活动中看到我的图像。 However, because I'm using a grid adapter, scrolling of the screen is not smooth and it lags. 但是,因为我使用的是网格适配器,所以屏幕滚动不流畅并且滞后。

What is the best practice in terms of smooth scrolling and memory management? 在平滑滚动和内存管理方面的最佳实践是什么?

Please try Lazy Loading in GridView. 请尝试在GridView中进行延迟加载。 check below link. 检查下面的链接。

http://blog.jamesbaca.net/?p=67 http://blog.jamesbaca.net/?p=67

OR 要么

https://github.com/thest1/LazyList https://github.com/thest1/LazyList

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Cache目录中的文件放入Android的ImageView中? - How do I put a File from my Cache directory in an ImageView on Android? Android WebView-从缓存加载图像 - Android WebView - Load Images from cache 如何将android LRU缓存与服务器中的图像一起使用 - How do I use android LRU cache with images from my server Android如何从GridView内部存储器加载图像 - android how to load images from internal memory in gridview 如何从毕加索的缓存中检索图像? - How to retrieve images from cache memory in picasso? 使用 Glide for Android,如何从资产和资源加载图像? - Using Glide for Android, how do I load images from asset and resources? 如何从JSON延迟加载图像以在Android GridView中预览? - How do I lazily load images from JSON to preview in an Android GridView? 如何在Android中一次仅将一个标签页加载到内存中? - How do I only load one tab into memory at a time in Android? 如何清除设备内存缓存 - how do I clear the device memory cache 像Amazon,Flipkart,Myntra这样的大型android应用程序虽然加载了很多图像,但缓存却非常少? 他们在哪里存储图像? - How big android applications like Amazon , Flipkart , Myntra has very less cache though they load a lot of images? Where do they store images?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM