Thank you yiankos1
Your approach will not work since the Data() that you receive in the Preview() event (NV21 format) is not the same format as the Data() in the PictureTaken() event (JPEG format) and my library expects the first one.
I suppose (correct me if I am wrong) that what you want to do is let the user decide wether to save or delete a picture just after it has been taken, avoiding calls to Mediascanner
With my library it could be done, but you would need to:
> Show the bitmap from the latest preview, in an imageview (as in the example)
> Copy the Data() from the PictureTaken event to a global variable
> Then ask the user to save/discard and if he chooses to save, do it.
But it has drawbacks. For instance, if you use the flash, the preview will be very different from the final image
A much more straightforward approach that works is (and without my library):
> On PictureTaken() event, save the picture in a private folder. For instance in "File.DirInternal", always with the same name "tmpFile.jpg"
> Ask the user to save/discard it
> If the user chooses to save, copy this "tmpFile.jpg" file to the output folder that you choose for your app (and rename it for instance using "YYMMDDHHMMSS.jpg")
> If the user decides to discard, just do nothing
This way, there will always be, at most, one "tmpFile.jpg" in your private folder