当前位置:编程学习 > JAVA >>

如何在ArrayList里面添加Bitmap?

ArrayList<Bitmap> bitmapArrayList= new ArrayList<Bitmap>();
a_1 = BitmapFactory.decodeResource(getResources(), R.drawable.a_1);
bitmapArrayList.add(a_1);
请问各位高手,这样会出错,应该怎么修改 ArrayList Bitmap --------------------编程问答-------------------- decodeResource的返回值是Bitmap么? --------------------编程问答-------------------- 问题已解决,BitmapFactory.decodeResource(getResources(), R.drawable.a_1)返回的是一个static Bitmap,而在ArrayList里面添加一个static变量就会出错,虽然不知道为什么
使用了一个Bitmap的数组来保存static变量是可以的 --------------------编程问答-------------------- 解决问题的感觉很好吧
补充:Java ,  Eclipse
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,