我想知道哪些是Android中用於存儲位圖的陣列實現的最佳選擇。將位圖存儲在ArrayList<Bitmap>
中是個不錯的主意,或者這不是一個好的解決方案。Android商店陣列的位圖
我想存儲像我的應用程序中編程創建的5個不同的位圖,並將它們存儲在數組中,它們將e繪製到e畫布上,但它無法正常工作。
下面是我在做什麼:
//beginning
ArrayList<Bitmap> temp = new ArrayList<Bitmap>();
//in some function where mBitmap is been created
temp.add(mBitmap);
//in my custom class which extends View
Bitmap bm = Bitmap.createBitmap(temp.get(temp.size()-1));
mCanvas.drawBitmap(bm);
invalidate();
但是從臨時位圖是永遠不會添加到我的mCanvas
。
任何想法爲什麼以及哪種方法是在Android/Java數組中存儲位圖的最佳方式?
LruCache是API 12級,我使用API LVL 7 –
可以使用Android HTTP ://developer.android.com/reference/android/support/v4/app/package-summary.html –
雖然這可能會在理論上回答這個問題,但我們希望您在答案中包含鏈接文章的基本部分,並提供[鏈接供參考](http://meta.stackexchange.com/q/8259)。如果做不到這一點,答案就會受到鏈接腐敗的威脅。 – Kev