-1

in my app i am using an Camera for an operation. i am able to open camera and i can work on it, but before opening the camera i want to have an option named Album. When i select this i want view the image stored in the android device so far that too in a grid view.

how to perform this...

Siva K
  • 4,968
  • 14
  • 82
  • 161
  • Possible duplicate of [How to access an image from the phone's photo gallery?](https://stackoverflow.com/questions/11144783/how-to-access-an-image-from-the-phones-photo-gallery) – Edward Brey May 30 '19 at 14:33

1 Answers1

2

If i am right what you want is to open up the gallery and view the images in it in a grid view. If this is what you are looking for following is a piece of code to do this.

Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 1);

Write the above code in the click event of the "Album" button.Above code will open up the gallery and displays the images in default grid view. Hope this helps you.

androidGuy
  • 5,553
  • 12
  • 39
  • 56