0

I am working on android project. My requirement is to store image from android gallery to remote mysql database. I am able to store the image into database by giving the image name in the code. But I want to store the selected image to database from gallery without mentioning the name of the image in the code. How can I do that? Please help me.....

hemanth kumar
  • 3,068
  • 10
  • 41
  • 64

1 Answers1

1

Invoke the gallery by starting Activity for result:

Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 
intent.setType("image/*"); 
startActivityForResult(intent, IMAGE_PICK); 

Described here in more detail: Get/pick an image from Android's built-in Gallery app programmatically

Community
  • 1
  • 1
Peter Knego
  • 79,991
  • 11
  • 123
  • 154