-3

I have a button made and when clicked I would like it to open up a gallery. How would I do this?

tshepang
  • 12,111
  • 21
  • 91
  • 136
brian
  • 1
  • 1
  • 1
  • 5
  • You can find several answers by just searching from Stack Overflow. This [thread](http://stackoverflow.com/questions/6016000/how-to-open-phones-gallery-through-code) for example. I hope it helps you. – naf Jul 14 '12 at 20:56

1 Answers1

1

There's already a question about this. You need to make an Intent. Here's the code from that answer:

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);
Community
  • 1
  • 1