Hi I'm looking for a way to save photos from the camera device directly without ask the user to save or not. I'm not implementing the Camera classes or overriding it. I'm simply using this code above. Do you have any ideas on how to do it?
TextReader tr = new TextReader(TextReader.DIRECTORY_EMPRESAS);
String path = TextReader.PARENT_PATH + "/" + TextReader.DIRECTORY_IMAGES;
String dataAtual = new SimpleDateFormat("yyMMddHHmmss").format(new Date());
if(tr.verificaDiretorios(path)){
String pictureName = dataAtual + DADOS.get(0) + ".jpg";
File pathEmpresa = new File(path + "/" + TextReader.FILE_NAME);
File imageFile;
if(pathEmpresa.exists()){
imageFile = new File(pathEmpresa, pictureName);
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imageFile));
//startActivity(i);
startActivityForResult(i, 2);
}else{
if(pathEmpresa.mkdir()){
imageFile = new File(pathEmpresa, pictureName);
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imageFile));
//startActivity(i);
startActivityForResult(i, 2);
}else{
throw new IllegalStateException("Não foi possivel criar o diretorio: " + pathEmpresa);
}
}