tags:

views:

68

answers:

1

Hello everyone. First, im new to developing for android and this forum. my question is this: i was looking at the "Hello world view: gridview" example and was wondering, how do i load all my images dynamically. for example in the ImageAdapter.java file, at the end there is:

private Integer[] mThumbIds = {
        R.drawable.sample_2, R.drawable.sample_3,
        R.drawable.sample_4, R.drawable.sample_5,
        R.drawable.sample_6, R.drawable.sample_7,
        R.drawable.sample_0, R.drawable.sample_1,
        R.drawable.sample_2, R.drawable.sample_3,
        R.drawable.sample_4, R.drawable.sample_5,
        R.drawable.sample_6, R.drawable.sample_7,
        R.drawable.sample_0, R.drawable.sample_1,
        R.drawable.sample_2, R.drawable.sample_3,
        R.drawable.sample_4, R.drawable.sample_5,
        R.drawable.sample_6, R.drawable.sample_7
};

but what if i dont know the images name (as the user will add new images). what i would like to do is grab the image name from an xml file and then load it into an array. how do i accomplish this?

A: 

seems like you are looking to get images from somewhere else other than the static resources. well here's one link which shows how to retrieve images from remote location.

http://www.anddev.org/gallery%5Fwith%5Fremote%5Fimages-t769.html

Raja
no, the images are a static resource ( the user can save images to a folder and i want the gridview to show all the images from that folder)
jason