I have an application that takes a picture with an intent and I must obtain the exact time when it is captured, the problem is that when I take the picture with intent
, I take the time when I give it ok ( onActivityResult()
) to the captured photo, and if the user takes the photo and it takes a minute to press ok, it keeps the time of the ok and not of the moment that I take the photo, I am something new in android.
//Comprobamos que la foto se a realizado
if (requestCode == 1 && resultCode == RESULT_OK) {
//Creamos un bitmap con la imagen recientemente
//almacenada en la memoria
Bitmap bMap = BitmapFactory.decodeFile(
Environment.getExternalStorageDirectory() +
"/System32photo/" + file);
SimpleDateFormat timeStampFormat = new SimpleDateFormat("yyyyMMddHHmmssSS");
Date myDate = new Date();
String date = timeStampFormat.format(myDate);
fechatomada =date.substring(0,8);
horatomada = date.substring(8,14);
I think the photo in its properties has the data that I need but I do not know how to take it when the image is loaded in ImagenView