1

I am using Droid fu's library which is GREAT! Im having problems implementing the webgalleryview though. I dont know how to go about implementing it.

I want it to display some images from a url. And cache the images. How would i do this with droid fu's library? WebGalleryAdapter.

Terrance
  • 11,764
  • 4
  • 54
  • 80
yoshi24
  • 3,147
  • 8
  • 45
  • 62

1 Answers1

0

Create an activity and bind a XML layout to it with a Gallery in it. Put it on Fill_Parent. Then simply put this code in your activity:

// Create a list of url's
List<String> imageURLs = new ArrayList<String>();
imageURLs.add("http://www.example.com/1.jpg");
imageURLs.add("http://www.example.com/2.jpg");
// Etc.

// Creates an adapter with the image url's for the overwritten getView method.
WebGalleryAdapter webGalleryAdapter = new WebGalleryAdapter(this, imageURLs);

// Get the gallery from the XML layout and set the web adapter.
Gallery gallery = (Gallery) findViewById(R.id.gallery);
gallery.setAdapter(webGalleryAdapter);
Ben Groot
  • 5,040
  • 3
  • 40
  • 47