I have a list of images in my drawable folder .
I have code to show them in coverflow.
So to refer images, I can use the following way using R.drawable._ etc, see below-
public class ImageAdapter extends BaseAdapter{
private Context context;
private ImageView[] images;
private Integer[] imageids={
R.drawable. image001,
R.drawable. image002,
R.drawable. image003,
R.drawable. image004,
R.drawable. image005,
R.drawable. image006,
R.drawable. image007,
R.drawable. image008,
R.drawable. image009,
R.drawable. image011,
R.drawable. image012,
R.drawable. image013,
R.drawable. image014,
R.drawable. image015,
R.drawable. image016,
R.drawable. image017,
R.drawable. image018,
R.drawable. image019,
R.drawable. image020,
R.drawable. image021,
R.drawable. image022,
R.drawable. image023,
R.drawable. image024,
};
public ImageAdapter(Context con)
{
this.context=con;
images=new ImageView[imageids.length];
}
}
Now my question is how to refer the images of my SDCARD in above imageid list.
I have found a related question on stackoverflow but no answer.
Please anyone answer this question if know.
Can I create the list of videoid’s also in the same way????
Thanks.
can be used refer to the file in the sdcard. For example, if you have a image file as image.jpg in a folder named myfolder in sdcard you can have,
This path can be used for video as well. As I can see your array is type Integer.Instead you can use a String array.
BitmapFactory.decodeFile(“”); is used to decode a file into a Bitmap. Here you can find a documentation.