Hear a photo-captured event

I just want to register for a video / photo.

Hopefully, but not necessarily, the event will be fired when the operation completes, so I won't be processing half of the photos or half of the videos I have taken.

Already tried:

fileObserver = new FileObserver(dcimDir, FileObserver.ALL_EVENTS)

      

I see events when moving using the file manager application, but not when shooting or copying.

Ideas?

+1


source to share


2 answers


Found a way by logging into all dcim subdirectories (except those starting with a period):

new FileObserver(dcimDir.toString(), FileObserver.CLOSE_WRITE)

      



The reason I have to check in on everyone is because different phones put picutes and videos in different folders - at least they're all under DCIM.

The reason the "CLOSE_WRITE" event is because I want to fire after the photo / video has finished, so I will not process only half of the photo / video.

0


source


There is another way too : ContentProvider



See another SE thread for more info: Android - How does Google+ instant download work?

0


source







All Articles