0

I want to ask whether the built-in camera to take photos and change the name in a specific folder.

Usually, we call this code to start built-in camera.

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
startActivityForResult( intent, 0 ); 

At onActivityResult(), we get the bitmap we just take and save it under a specific photo. As i know, it works for a single photo. However, if user takes many photos, can i get a list of these photo name??

Thanks all.

KingWu
  • 370
  • 1
  • 4
  • 21

1 Answers1

0

Each time a user takes a photo you must save it (under "onActivityResult()") with a different name so the last capture does now overwrite the previous. One easy solution is to concatenate in the photo name a timestamp so the photo name will become unique and it will be saved as a new photo.

If you want to get the list of those photos saved, you can use this example "android-coding.blogspot.gr/2011/10/list-filesdirectory-in-android.html"

Panos
  • 7,227
  • 13
  • 60
  • 95
  • Thanks. As i know, user take a photo and he need to click the "Back" icon to back to my app, which will trigger onActivityResult() once. It is inconvenient that users cannot take a few photo for one time. I have one problems that i call the built-in camera and take a few photo. At the moment, i open the Camera app to take another photos. When i go back to my app, i don't know which photo is taken from the built-in camera. How to solve it? – KingWu Jul 03 '12 at 14:24