Reputation: 6517
Hi :) I'm trying to write an android application that downloads a bunch of images and afterwads displays them in a gallery. I managed to download the images (i did download them do the data/data/project directory - not sure if that's right) but now i can't access them (i tried using the setImageURI method of the imageView to display the image after I've created an Uri instance via Uri.Builder().appendPath("data/data/project/file.jpg").build() but it was to no avail). I'm new to android developing so any help will be greatly appreciated. Thanks!
Upvotes: 1
Views: 2634
Reputation: 10479
I started writing up an example, but decided that it was a waste of time since the net is littered with better examples then I could create.
At a high level, you'll need to do this:
The typical mechanism for viewing a set of resources like this is the Adapter pattern. As I mentioned, there is a good example here which also encompasses the use of AsyncTask and some other patterns typical of Android programming which you should become familiar with. Review that and see if you have further questions.
Upvotes: 3
Reputation: 2182
Try:
Uri uri = Uri.parse("file:///data/data/project/file.jpg");
image.setImageURI(uri);
Upvotes: 2