我正在開發一個Android應用程序,它需要將手機的圖像顯示到GridView上。我需要做的是加載這些圖像異步,並沒有用戶等待,直到所有的照片已被加載。 通過使用CursorLoader或AsyncTaskLoader,最好的方法是什麼?Android - 將大量圖像加載到GridView上
在此先感謝。
我正在開發一個Android應用程序,它需要將手機的圖像顯示到GridView上。我需要做的是加載這些圖像異步,並沒有用戶等待,直到所有的照片已被加載。 通過使用CursorLoader或AsyncTaskLoader,最好的方法是什麼?Android - 將大量圖像加載到GridView上
在此先感謝。
我強烈建議你Picasso
:http://square.github.io/picasso/
這是一個與異步線程加載圖像的完美庫。
您可以在適配器載入圖片:
Picasso.with(yourContext).load("http://yoururl.com/yourimage.png").into(yourImageView);
想實現這個我自己和所有類型的問題已經被解決了別人我去使用畢加索來了。
在1行代碼加載圖像:
Picasso.with(context).load(imageUrl).into(imageView_XY);
http://square.github.io/picasso/
備選:
http://developer.android.com/training/displaying-bitmaps /index.html – tyczj 2015-04-02 14:10:12