Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to populate gridview with image just selected from gallery or captured from camera

I have Image Gridview and I want to add images ONE by ONE to gridview selecting from gallery or image captured from camera.

like image 478
Jaykumar Donga Avatar asked Jul 19 '12 10:07

Jaykumar Donga


2 Answers

What you can do in your case is always have an image assigned to the last item of your Grid View. Clicking on that last item you can create a popup asking for you to take it to you gallery or for camera. Now if the user clicks on back button or decides to cancel keep showing that last populated '+' sign image in your grid view else if any other option is opted you can navigate to the desired action by having in an onActivityResult(). if the result code is positive and you may continue with:

1) Delete the last item from grid view i.e, the '+' sign image
2) Appending the image either taken from camera or gallery
3) Appending the image having '+' sign itself

And always put a condition for the last item of your grid view to point it to the dialog for Navigating to gallery or Click from camera. For other items you may continue with your desired requirements.

Let me know if it helped.

Thanks

like image 78
abhy Avatar answered Oct 02 '22 22:10

abhy


I think below links will help you to create that..

  • gridview with image and text android
  • How to implement Image Gallery in Gridview in android?
  • http://vikaskanani.wordpress.com/2011/07/20/android-custom-image-gallery-with-checkbox-in-grid-to-select-multiple/
like image 26
ridoy Avatar answered Oct 02 '22 22:10

ridoy