我在我的布局中使用了图片轮播,为此我使用了。
private Integer[] mImageIds = { R.drawable.j, R.drawable.f,R.drawable.i, R.drawable.g, R.drawable.k };
我想从SD卡中获取图片并将这些图像存储到数组中。如何做到这一点?以下是我的代码。我将缩略图存储在数据库中。我已将位图转换为可绘制对象,现在该如何将其存储到数组mImages中?
List<String> thumb = new ArrayList<String>();
public Integer[] mImageIds;
Bitmap bitmap;
thumb = db.getRecomdThumb();//get image address from db
for(int i = 0; i < thumb.size();i++){
bitmap = BitmapFactory.decodeFile(thumb.get(i));
Drawable d = new BitmapDrawable(getResources(),bitmap);
}